import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        boolean[] bs = new boolean[s.length()];
        boolean[] p = new boolean[s.length()];
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) == '0') {
                bs[i] = false;
            } else {
                bs[i] = true;
            }
            if (i % 2 == 0) {
                p[i] = false;
            } else {
                p[i] = true;
            }
        }
        int counter1 = 0;
        int counter2 = 0;
        for (int i = 0; i < bs.length; i++) {
            if (bs[i] != p[i]) {
                counter1++;
            } else {
                counter2++;
            }
        }
        System.out.println(Math.min(counter1, counter2));
        sc.close();
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        boolean[] bs = new boolean[s.length()];
        boolean[] p = new boolean[s.length()];
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) == '0') {
                bs[i] = false;
            } else {
                bs[i] = true;
            }
            if (i % 2 == 0) {
                p[i] = false;
            } else {
                p[i] = true;
            }
        }
        int counter1 = 0;
        int counter2 = 0;
        for (int i = 0; i < bs.length; i++) {
            if (bs[i] != p[i]) {
                counter1++;
            } else {
                counter2++;
            }
        }
        System.out.println(Math.min(counter1, counter2));
        sc.close();
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        boolean[] bs = new boolean[s.length()];
        boolean[] p = new boolean[s.length()];
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) == '0') {
                bs[i] = false;
            } else {
                bs[i] = true;
            }
            if (i % 2 == 0) {
                p[i] = false;
            } else {
                p[i] = true;
            }
        }
        int counter1 = 0;
        int counter2 = 0;
        for (int i = 0; i < bs.length; i++) {
            if (bs[i] != p[i]) {
                counter1++;
            } else {
                counter2++;
            }
        }
        System.out.println(Math.min(counter1, counter2));
        sc.close();
    } main {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        boolean[] bs = new boolean[s.length()];
        boolean[] p = new boolean[s.length()];
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) == '0') {
                bs[i] = false;
            } else {
                bs[i] = true;
            }
            if (i % 2 == 0) {
                p[i] = false;
            } else {
                p[i] = true;
            }
        }
        int counter1 = 0;
        int counter2 = 0;
        for (int i = 0; i < bs.length; i++) {
            if (bs[i] != p[i]) {
                counter1++;
            } else {
                counter2++;
            }
        }
        System.out.println(Math.min(counter1, counter2));
        sc.close();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc boolean[] bs = new boolean[s.length()]; bs new boolean[s.length()] s.length() s.length s boolean[] p = new boolean[s.length()]; p new boolean[s.length()] s.length() s.length s for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) == '0') {
                bs[i] = false;
            } else {
                bs[i] = true;
            }
            if (i % 2 == 0) {
                p[i] = false;
            } else {
                p[i] = true;
            }
        } int i = 0; int i = 0; i 0 i < s.length() i s.length() s.length s i++ i++ i {
            if (s.charAt(i) == '0') {
                bs[i] = false;
            } else {
                bs[i] = true;
            }
            if (i % 2 == 0) {
                p[i] = false;
            } else {
                p[i] = true;
            }
        } {
            if (s.charAt(i) == '0') {
                bs[i] = false;
            } else {
                bs[i] = true;
            }
            if (i % 2 == 0) {
                p[i] = false;
            } else {
                p[i] = true;
            }
        } if (s.charAt(i) == '0') {
                bs[i] = false;
            } else {
                bs[i] = true;
            } s.charAt(i) == '0' s.charAt(i) s.charAt s i '0' {
                bs[i] = false;
            } bs[i] = false bs[i] bs i false {
                bs[i] = true;
            } bs[i] = true bs[i] bs i true if (i % 2 == 0) {
                p[i] = false;
            } else {
                p[i] = true;
            } i % 2 == 0 i % 2 i 2 0 {
                p[i] = false;
            } p[i] = false p[i] p i false {
                p[i] = true;
            } p[i] = true p[i] p i true int counter1 = 0; counter1 0 int counter2 = 0; counter2 0 for (int i = 0; i < bs.length; i++) {
            if (bs[i] != p[i]) {
                counter1++;
            } else {
                counter2++;
            }
        } int i = 0; int i = 0; i 0 i < bs.length i bs.length bs bs.length i++ i++ i {
            if (bs[i] != p[i]) {
                counter1++;
            } else {
                counter2++;
            }
        } {
            if (bs[i] != p[i]) {
                counter1++;
            } else {
                counter2++;
            }
        } if (bs[i] != p[i]) {
                counter1++;
            } else {
                counter2++;
            } bs[i] != p[i] bs[i] bs i p[i] p i {
                counter1++;
            } counter1++ counter1 {
                counter2++;
            } counter2++ counter2 System.out.println(Math.min(counter1, counter2)) System.out.println System.out System System.out Math.min(counter1, counter2) Math.min Math counter1 counter2 sc.close() sc.close sc String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        boolean[] bs = new boolean[s.length()];
        boolean[] p = new boolean[s.length()];
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) == '0') {
                bs[i] = false;
            } else {
                bs[i] = true;
            }
            if (i % 2 == 0) {
                p[i] = false;
            } else {
                p[i] = true;
            }
        }
        int counter1 = 0;
        int counter2 = 0;
        for (int i = 0; i < bs.length; i++) {
            if (bs[i] != p[i]) {
                counter1++;
            } else {
                counter2++;
            }
        }
        System.out.println(Math.min(counter1, counter2));
        sc.close();
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        boolean[] bs = new boolean[s.length()];
        boolean[] p = new boolean[s.length()];
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) == '0') {
                bs[i] = false;
            } else {
                bs[i] = true;
            }
            if (i % 2 == 0) {
                p[i] = false;
            } else {
                p[i] = true;
            }
        }
        int counter1 = 0;
        int counter2 = 0;
        for (int i = 0; i < bs.length; i++) {
            if (bs[i] != p[i]) {
                counter1++;
            } else {
                counter2++;
            }
        }
        System.out.println(Math.min(counter1, counter2));
        sc.close();
    }
} Main
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        boolean[] bs = new boolean[s.length()];
        boolean[] p = new boolean[s.length()];
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) == '0') {
                bs[i] = false;
            } else {
                bs[i] = true;
            }
            if (i % 2 == 0) {
                p[i] = false;
            } else {
                p[i] = true;
            }
        }
        int counter1 = 0;
        int counter2 = 0;
        for (int i = 0; i < bs.length; i++) {
            if (bs[i] != p[i]) {
                counter1++;
            } else {
                counter2++;
            }
        }
        System.out.println(Math.min(counter1, counter2));
        sc.close();
    }
}