import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int z = 0;
        int o = 0;
        for (int i = 0; i < s.length(); i++) {
            if ((i + 1) % 2 == 0) {
                if (s.charAt(i) != '0') {
                    z++;
                } else {
                    o++;
                }
            } else {
                if (s.charAt(i) != '1') {
                    z++;
                } else {
                    o++;
                }
            }
        }
        System.out.println(Math.min(z, o));
    }
} import java.util.Scanner; Scanner java.util public class Main {

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

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

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int z = 0;
        int o = 0;
        for (int i = 0; i < s.length(); i++) {
            if ((i + 1) % 2 == 0) {
                if (s.charAt(i) != '0') {
                    z++;
                } else {
                    o++;
                }
            } else {
                if (s.charAt(i) != '1') {
                    z++;
                } else {
                    o++;
                }
            }
        }
        System.out.println(Math.min(z, o));
    }
} Main
import java.util.Scanner;

public class Main {

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