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;
    }
} import java.io.PrintStream; PrintStream java.io import java.util.Scanner; Scanner java.util 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;
    }
} Main static final PrintStream so = System.out; so System.out System System.out static final Scanner sc = new Scanner(System.in); sc new Scanner(System.in) static final char BLACK = '0'; BLACK '0' static final char WHITE = '1'; WHITE '1' public static void main(String[] args) {
        char[] tiles = nsToChars();
        so.println(Math.min(count(tiles, BLACK), count(tiles, WHITE)));
    } main {
        char[] tiles = nsToChars();
        so.println(Math.min(count(tiles, BLACK), count(tiles, WHITE)));
    } char[] tiles = nsToChars(); tiles nsToChars() nsToChars so.println(Math.min(count(tiles, BLACK), count(tiles, WHITE))) so.println so Math.min(count(tiles, BLACK), count(tiles, WHITE)) Math.min Math count(tiles, BLACK) count tiles BLACK count(tiles, WHITE) count tiles WHITE String[] args args 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;
    } count {
        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;
    } int count = 0; 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++;
                }
            }
        } int i = 0; int i = 0; i 0 i < tiles.length i tiles.length tiles tiles.length i++ i++ i {
            if (i % 2 == 0) {
                if (tiles[i] == start) {
                    count++;
                }
            } else {
                if (tiles[i] == rev(start)) {
                    count++;
                }
            }
        } {
            if (i % 2 == 0) {
                if (tiles[i] == start) {
                    count++;
                }
            } else {
                if (tiles[i] == rev(start)) {
                    count++;
                }
            }
        } if (i % 2 == 0) {
                if (tiles[i] == start) {
                    count++;
                }
            } else {
                if (tiles[i] == rev(start)) {
                    count++;
                }
            } i % 2 == 0 i % 2 i 2 0 {
                if (tiles[i] == start) {
                    count++;
                }
            } if (tiles[i] == start) {
                    count++;
                } tiles[i] == start tiles[i] tiles i start {
                    count++;
                } count++ count {
                if (tiles[i] == rev(start)) {
                    count++;
                }
            } if (tiles[i] == rev(start)) {
                    count++;
                } tiles[i] == rev(start) tiles[i] tiles i rev(start) rev start {
                    count++;
                } count++ count return count; count char[] tiles tiles char start start static char rev(char c) {
        return c == BLACK ? WHITE : BLACK;
    } rev {
        return c == BLACK ? WHITE : BLACK;
    } return c == BLACK ? WHITE : BLACK; c == BLACK ? WHITE : BLACK c == BLACK c BLACK WHITE BLACK char c c static int ni() {
        return sc.nextInt();
    } ni {
        return sc.nextInt();
    } return sc.nextInt(); sc.nextInt() sc.nextInt sc static long nl() {
        return sc.nextLong();
    } nl {
        return sc.nextLong();
    } return sc.nextLong(); sc.nextLong() sc.nextLong sc static String ns() {
        return sc.next();
    } ns {
        return sc.next();
    } return sc.next(); sc.next() sc.next sc static char[] nsToChars() {
        return sc.next().toCharArray();
    } nsToChars {
        return sc.next().toCharArray();
    } return sc.next().toCharArray(); sc.next().toCharArray() sc.next().toCharArray sc.next() sc.next sc static int[] nints(int n) {
        return nints(n, 0, 0);
    } nints {
        return nints(n, 0, 0);
    } return nints(n, 0, 0); nints(n, 0, 0) nints n 0 0 int n n 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;
    } nints {
        int[] a = new int[padHead + n + padTail];
        for (int i = 0; i < n; i++)
            a[padHead + i] = ni();
        return a;
    } int[] a = new int[padHead + n + padTail]; a new int[padHead + n + padTail] padHead + n + padTail padHead + n + padTail padHead n padTail for (int i = 0; i < n; i++)
            a[padHead + i] = ni(); int i = 0; int i = 0; i 0 i < n i n i++ i++ i a[padHead + i] = ni(); a[padHead + i] = ni() a[padHead + i] a padHead + i padHead i ni() ni return a; a int n n int padHead padHead int padTail padTail 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;
    }
} 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;
    }
} Main
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;
    }
}
