import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char[] s = sc.next().toCharArray();
        int ans1 = 0;
        int ans2 = 0;
        for (int i = 0; i < s.length; i++) {
            if(i % 2 == 0 && s[i] == '0') {
                ans1++;
            } else if(i % 2 == 0 && s[i] == '1'){
                ans2++;
            } else if(i % 2 != 0 && s[i] == '0') {
                ans2++;
            } else if(i % 2 != 0 && s[i] == '1') {
                ans1++;
            }
        }
        System.out.println(Math.min(ans1, ans2));
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char[] s = sc.next().toCharArray();
        int ans1 = 0;
        int ans2 = 0;
        for (int i = 0; i < s.length; i++) {
            if(i % 2 == 0 && s[i] == '0') {
                ans1++;
            } else if(i % 2 == 0 && s[i] == '1'){
                ans2++;
            } else if(i % 2 != 0 && s[i] == '0') {
                ans2++;
            } else if(i % 2 != 0 && s[i] == '1') {
                ans1++;
            }
        }
        System.out.println(Math.min(ans1, ans2));
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char[] s = sc.next().toCharArray();
        int ans1 = 0;
        int ans2 = 0;
        for (int i = 0; i < s.length; i++) {
            if(i % 2 == 0 && s[i] == '0') {
                ans1++;
            } else if(i % 2 == 0 && s[i] == '1'){
                ans2++;
            } else if(i % 2 != 0 && s[i] == '0') {
                ans2++;
            } else if(i % 2 != 0 && s[i] == '1') {
                ans1++;
            }
        }
        System.out.println(Math.min(ans1, ans2));
    } main {
        Scanner sc = new Scanner(System.in);
        char[] s = sc.next().toCharArray();
        int ans1 = 0;
        int ans2 = 0;
        for (int i = 0; i < s.length; i++) {
            if(i % 2 == 0 && s[i] == '0') {
                ans1++;
            } else if(i % 2 == 0 && s[i] == '1'){
                ans2++;
            } else if(i % 2 != 0 && s[i] == '0') {
                ans2++;
            } else if(i % 2 != 0 && s[i] == '1') {
                ans1++;
            }
        }
        System.out.println(Math.min(ans1, ans2));
    } 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 ans1 = 0; ans1 0 int ans2 = 0; ans2 0 for (int i = 0; i < s.length; i++) {
            if(i % 2 == 0 && s[i] == '0') {
                ans1++;
            } else if(i % 2 == 0 && s[i] == '1'){
                ans2++;
            } else if(i % 2 != 0 && s[i] == '0') {
                ans2++;
            } else if(i % 2 != 0 && s[i] == '1') {
                ans1++;
            }
        } int i = 0; int i = 0; i 0 i < s.length i s.length s s.length i++ i++ i {
            if(i % 2 == 0 && s[i] == '0') {
                ans1++;
            } else if(i % 2 == 0 && s[i] == '1'){
                ans2++;
            } else if(i % 2 != 0 && s[i] == '0') {
                ans2++;
            } else if(i % 2 != 0 && s[i] == '1') {
                ans1++;
            }
        } {
            if(i % 2 == 0 && s[i] == '0') {
                ans1++;
            } else if(i % 2 == 0 && s[i] == '1'){
                ans2++;
            } else if(i % 2 != 0 && s[i] == '0') {
                ans2++;
            } else if(i % 2 != 0 && s[i] == '1') {
                ans1++;
            }
        } if(i % 2 == 0 && s[i] == '0') {
                ans1++;
            } else if(i % 2 == 0 && s[i] == '1'){
                ans2++;
            } else if(i % 2 != 0 && s[i] == '0') {
                ans2++;
            } else if(i % 2 != 0 && s[i] == '1') {
                ans1++;
            } i % 2 == 0 && s[i] == '0' i % 2 == 0 i % 2 i 2 0 s[i] == '0' s[i] s i '0' {
                ans1++;
            } ans1++ ans1 if(i % 2 == 0 && s[i] == '1'){
                ans2++;
            } else if(i % 2 != 0 && s[i] == '0') {
                ans2++;
            } else if(i % 2 != 0 && s[i] == '1') {
                ans1++;
            } i % 2 == 0 && s[i] == '1' i % 2 == 0 i % 2 i 2 0 s[i] == '1' s[i] s i '1' {
                ans2++;
            } ans2++ ans2 if(i % 2 != 0 && s[i] == '0') {
                ans2++;
            } else if(i % 2 != 0 && s[i] == '1') {
                ans1++;
            } i % 2 != 0 && s[i] == '0' i % 2 != 0 i % 2 i 2 0 s[i] == '0' s[i] s i '0' {
                ans2++;
            } ans2++ ans2 if(i % 2 != 0 && s[i] == '1') {
                ans1++;
            } i % 2 != 0 && s[i] == '1' i % 2 != 0 i % 2 i 2 0 s[i] == '1' s[i] s i '1' {
                ans1++;
            } ans1++ ans1 System.out.println(Math.min(ans1, ans2)) System.out.println System.out System System.out Math.min(ans1, ans2) Math.min Math ans1 ans2 String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char[] s = sc.next().toCharArray();
        int ans1 = 0;
        int ans2 = 0;
        for (int i = 0; i < s.length; i++) {
            if(i % 2 == 0 && s[i] == '0') {
                ans1++;
            } else if(i % 2 == 0 && s[i] == '1'){
                ans2++;
            } else if(i % 2 != 0 && s[i] == '0') {
                ans2++;
            } else if(i % 2 != 0 && s[i] == '1') {
                ans1++;
            }
        }
        System.out.println(Math.min(ans1, ans2));
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char[] s = sc.next().toCharArray();
        int ans1 = 0;
        int ans2 = 0;
        for (int i = 0; i < s.length; i++) {
            if(i % 2 == 0 && s[i] == '0') {
                ans1++;
            } else if(i % 2 == 0 && s[i] == '1'){
                ans2++;
            } else if(i % 2 != 0 && s[i] == '0') {
                ans2++;
            } else if(i % 2 != 0 && s[i] == '1') {
                ans1++;
            }
        }
        System.out.println(Math.min(ans1, ans2));
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char[] s = sc.next().toCharArray();
        int ans1 = 0;
        int ans2 = 0;
        for (int i = 0; i < s.length; i++) {
            if(i % 2 == 0 && s[i] == '0') {
                ans1++;
            } else if(i % 2 == 0 && s[i] == '1'){
                ans2++;
            } else if(i % 2 != 0 && s[i] == '0') {
                ans2++;
            } else if(i % 2 != 0 && s[i] == '1') {
                ans1++;
            }
        }
        System.out.println(Math.min(ans1, ans2));
    }
}