import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        @SuppressWarnings("resource")
        Scanner sc = new Scanner(System.in);
        char[] s = sc.next().toCharArray();

        int count = 0;
        for (int i = 0 ; i < s.length ; i++) {
            if (i % 2 == 0) {
                if (s[i] == '0') {
                    count++;
                }
            } else {
                if (s[i] == '1') {
                    count++;
                }
            }
        }
        int count2 = 0;
        for (int i = 0 ; i < s.length ; i++) {
            if (i % 2 == 1) {
                if (s[i] == '0') {
                    count2++;
                }
            } else {
                if (s[i] == '1') {
                    count2++;
                }
            }
        }
        System.out.println(Math.min(count, count2));
    }

} import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        @SuppressWarnings("resource")
        Scanner sc = new Scanner(System.in);
        char[] s = sc.next().toCharArray();

        int count = 0;
        for (int i = 0 ; i < s.length ; i++) {
            if (i % 2 == 0) {
                if (s[i] == '0') {
                    count++;
                }
            } else {
                if (s[i] == '1') {
                    count++;
                }
            }
        }
        int count2 = 0;
        for (int i = 0 ; i < s.length ; i++) {
            if (i % 2 == 1) {
                if (s[i] == '0') {
                    count2++;
                }
            } else {
                if (s[i] == '1') {
                    count2++;
                }
            }
        }
        System.out.println(Math.min(count, count2));
    }

} Main public static void main(String[] args) {
        @SuppressWarnings("resource")
        Scanner sc = new Scanner(System.in);
        char[] s = sc.next().toCharArray();

        int count = 0;
        for (int i = 0 ; i < s.length ; i++) {
            if (i % 2 == 0) {
                if (s[i] == '0') {
                    count++;
                }
            } else {
                if (s[i] == '1') {
                    count++;
                }
            }
        }
        int count2 = 0;
        for (int i = 0 ; i < s.length ; i++) {
            if (i % 2 == 1) {
                if (s[i] == '0') {
                    count2++;
                }
            } else {
                if (s[i] == '1') {
                    count2++;
                }
            }
        }
        System.out.println(Math.min(count, count2));
    } main {
        @SuppressWarnings("resource")
        Scanner sc = new Scanner(System.in);
        char[] s = sc.next().toCharArray();

        int count = 0;
        for (int i = 0 ; i < s.length ; i++) {
            if (i % 2 == 0) {
                if (s[i] == '0') {
                    count++;
                }
            } else {
                if (s[i] == '1') {
                    count++;
                }
            }
        }
        int count2 = 0;
        for (int i = 0 ; i < s.length ; i++) {
            if (i % 2 == 1) {
                if (s[i] == '0') {
                    count2++;
                }
            } else {
                if (s[i] == '1') {
                    count2++;
                }
            }
        }
        System.out.println(Math.min(count, count2));
    } @SuppressWarnings("resource")
        Scanner sc = new Scanner(System.in); sc new Scanner(System.in) char[] s = sc.next().toCharArray(); s sc.next().toCharArray() sc.next().toCharArray sc.next() sc.next sc int count = 0; count 0 for (int i = 0 ; i < s.length ; i++) {
            if (i % 2 == 0) {
                if (s[i] == '0') {
                    count++;
                }
            } else {
                if (s[i] == '1') {
                    count++;
                }
            }
        } int i = 0 ; int i = 0 ; i 0 i < s.length i s.length s s.length i++ i++ i {
            if (i % 2 == 0) {
                if (s[i] == '0') {
                    count++;
                }
            } else {
                if (s[i] == '1') {
                    count++;
                }
            }
        } {
            if (i % 2 == 0) {
                if (s[i] == '0') {
                    count++;
                }
            } else {
                if (s[i] == '1') {
                    count++;
                }
            }
        } if (i % 2 == 0) {
                if (s[i] == '0') {
                    count++;
                }
            } else {
                if (s[i] == '1') {
                    count++;
                }
            } i % 2 == 0 i % 2 i 2 0 {
                if (s[i] == '0') {
                    count++;
                }
            } if (s[i] == '0') {
                    count++;
                } s[i] == '0' s[i] s i '0' {
                    count++;
                } count++ count {
                if (s[i] == '1') {
                    count++;
                }
            } if (s[i] == '1') {
                    count++;
                } s[i] == '1' s[i] s i '1' {
                    count++;
                } count++ count int count2 = 0; count2 0 for (int i = 0 ; i < s.length ; i++) {
            if (i % 2 == 1) {
                if (s[i] == '0') {
                    count2++;
                }
            } else {
                if (s[i] == '1') {
                    count2++;
                }
            }
        } int i = 0 ; int i = 0 ; i 0 i < s.length i s.length s s.length i++ i++ i {
            if (i % 2 == 1) {
                if (s[i] == '0') {
                    count2++;
                }
            } else {
                if (s[i] == '1') {
                    count2++;
                }
            }
        } {
            if (i % 2 == 1) {
                if (s[i] == '0') {
                    count2++;
                }
            } else {
                if (s[i] == '1') {
                    count2++;
                }
            }
        } if (i % 2 == 1) {
                if (s[i] == '0') {
                    count2++;
                }
            } else {
                if (s[i] == '1') {
                    count2++;
                }
            } i % 2 == 1 i % 2 i 2 1 {
                if (s[i] == '0') {
                    count2++;
                }
            } if (s[i] == '0') {
                    count2++;
                } s[i] == '0' s[i] s i '0' {
                    count2++;
                } count2++ count2 {
                if (s[i] == '1') {
                    count2++;
                }
            } if (s[i] == '1') {
                    count2++;
                } s[i] == '1' s[i] s i '1' {
                    count2++;
                } count2++ count2 System.out.println(Math.min(count, count2)) System.out.println System.out System System.out Math.min(count, count2) Math.min Math count count2 String[] args args public class Main {

    public static void main(String[] args) {
        @SuppressWarnings("resource")
        Scanner sc = new Scanner(System.in);
        char[] s = sc.next().toCharArray();

        int count = 0;
        for (int i = 0 ; i < s.length ; i++) {
            if (i % 2 == 0) {
                if (s[i] == '0') {
                    count++;
                }
            } else {
                if (s[i] == '1') {
                    count++;
                }
            }
        }
        int count2 = 0;
        for (int i = 0 ; i < s.length ; i++) {
            if (i % 2 == 1) {
                if (s[i] == '0') {
                    count2++;
                }
            } else {
                if (s[i] == '1') {
                    count2++;
                }
            }
        }
        System.out.println(Math.min(count, count2));
    }

} public class Main {

    public static void main(String[] args) {
        @SuppressWarnings("resource")
        Scanner sc = new Scanner(System.in);
        char[] s = sc.next().toCharArray();

        int count = 0;
        for (int i = 0 ; i < s.length ; i++) {
            if (i % 2 == 0) {
                if (s[i] == '0') {
                    count++;
                }
            } else {
                if (s[i] == '1') {
                    count++;
                }
            }
        }
        int count2 = 0;
        for (int i = 0 ; i < s.length ; i++) {
            if (i % 2 == 1) {
                if (s[i] == '0') {
                    count2++;
                }
            } else {
                if (s[i] == '1') {
                    count2++;
                }
            }
        }
        System.out.println(Math.min(count, count2));
    }

} Main
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        @SuppressWarnings("resource")
        Scanner sc = new Scanner(System.in);
        char[] s = sc.next().toCharArray();

        int count = 0;
        for (int i = 0 ; i < s.length ; i++) {
            if (i % 2 == 0) {
                if (s[i] == '0') {
                    count++;
                }
            } else {
                if (s[i] == '1') {
                    count++;
                }
            }
        }
        int count2 = 0;
        for (int i = 0 ; i < s.length ; i++) {
            if (i % 2 == 1) {
                if (s[i] == '0') {
                    count2++;
                }
            } else {
                if (s[i] == '1') {
                    count2++;
                }
            }
        }
        System.out.println(Math.min(count, count2));
    }

}
