import java.io.PrintStream;
import java.util.Scanner;

public class Main {
    static final PrintStream so = System.out;
    static final Scanner sc = new Scanner(System.in);
    static final char BLACK = '0';
    static final char WHITE = '1';
    
    public static void main(String[] args) {
        char[] tiles = nsToChars();
        so.println(Math.min(count(tiles, BLACK), count(tiles, WHITE)));
    }
    
    static int count(char[] tiles, char start) {
        int count = 0;
        for (int i = 0; i < tiles.length; i++) {
            if (i % 2 == 0) {
                if (tiles[i] == start) {
                    count++;
                }
            } else {
                if (tiles[i] == rev(start)) {
                    count++;
                }
            }
        }
        return count;
    }
    
    static char rev(char c) {
        return c == BLACK ? WHITE : BLACK;
    }

    static int ni() {
        return sc.nextInt();
    }

    static long nl() {
        return sc.nextLong();
    }

    static String ns() {
        return sc.next();
    }

    static char[] nsToChars() {
        return sc.next().toCharArray();
    }

    static int[] nints(int n) {
        return nints(n, 0, 0);
    }

    static int[] nints(int n, int padHead, int padTail) {
        int[] a = new int[padHead + n + padTail];
        for (int i = 0; i < n; i++)
            a[padHead + i] = ni();
        return a;
    }
}

/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz