import java.util.*;

public class Main {

    private static Scanner sc = new Scanner(System.in);

    public static void main(String args[]) {

        String s = sc.nextLine();

        int l = s.length();

        String ans1, ans2;

        StringBuilder sb1 = new StringBuilder();
        StringBuilder sb2 = new StringBuilder();

        for (int i=0; i < l; i++) {
            sb1.append(i % 2 == 0 ? "1" : "0");
            sb2.append(i % 2 != 0 ? "1" : "0");
        }

        ans1 = sb1.toString();
        ans2 = sb2.toString();

        int d1 = distance(s, ans1);
        int d2 = distance(s, ans2);

        System.out.println(d1 > d2 ? d2 : d1);

    }

    private static int distance(String s, String target) {
        int c = 0;
        char[] s1 = s.toCharArray();
        char[] s2 = target.toCharArray();
        for (int i=0; i < s.length(); i++) {
            if (s1[i] != s2[i])
                c++;
        }
        return c;
    }

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

    private static Scanner sc = new Scanner(System.in);

    public static void main(String args[]) {

        String s = sc.nextLine();

        int l = s.length();

        String ans1, ans2;

        StringBuilder sb1 = new StringBuilder();
        StringBuilder sb2 = new StringBuilder();

        for (int i=0; i < l; i++) {
            sb1.append(i % 2 == 0 ? "1" : "0");
            sb2.append(i % 2 != 0 ? "1" : "0");
        }

        ans1 = sb1.toString();
        ans2 = sb2.toString();

        int d1 = distance(s, ans1);
        int d2 = distance(s, ans2);

        System.out.println(d1 > d2 ? d2 : d1);

    }

    private static int distance(String s, String target) {
        int c = 0;
        char[] s1 = s.toCharArray();
        char[] s2 = target.toCharArray();
        for (int i=0; i < s.length(); i++) {
            if (s1[i] != s2[i])
                c++;
        }
        return c;
    }

} Main private static Scanner sc = new Scanner(System.in); sc new Scanner(System.in) public static void main(String args[]) {

        String s = sc.nextLine();

        int l = s.length();

        String ans1, ans2;

        StringBuilder sb1 = new StringBuilder();
        StringBuilder sb2 = new StringBuilder();

        for (int i=0; i < l; i++) {
            sb1.append(i % 2 == 0 ? "1" : "0");
            sb2.append(i % 2 != 0 ? "1" : "0");
        }

        ans1 = sb1.toString();
        ans2 = sb2.toString();

        int d1 = distance(s, ans1);
        int d2 = distance(s, ans2);

        System.out.println(d1 > d2 ? d2 : d1);

    } main {

        String s = sc.nextLine();

        int l = s.length();

        String ans1, ans2;

        StringBuilder sb1 = new StringBuilder();
        StringBuilder sb2 = new StringBuilder();

        for (int i=0; i < l; i++) {
            sb1.append(i % 2 == 0 ? "1" : "0");
            sb2.append(i % 2 != 0 ? "1" : "0");
        }

        ans1 = sb1.toString();
        ans2 = sb2.toString();

        int d1 = distance(s, ans1);
        int d2 = distance(s, ans2);

        System.out.println(d1 > d2 ? d2 : d1);

    } String s = sc.nextLine(); s sc.nextLine() sc.nextLine sc int l = s.length(); l s.length() s.length s String ans1 ans1 ans2; ans2 StringBuilder sb1 = new StringBuilder(); sb1 new StringBuilder() StringBuilder sb2 = new StringBuilder(); sb2 new StringBuilder() for (int i=0; i < l; i++) {
            sb1.append(i % 2 == 0 ? "1" : "0");
            sb2.append(i % 2 != 0 ? "1" : "0");
        } int i=0; int i=0; i 0 i < l i l i++ i++ i {
            sb1.append(i % 2 == 0 ? "1" : "0");
            sb2.append(i % 2 != 0 ? "1" : "0");
        } {
            sb1.append(i % 2 == 0 ? "1" : "0");
            sb2.append(i % 2 != 0 ? "1" : "0");
        } sb1.append(i % 2 == 0 ? "1" : "0") sb1.append sb1 i % 2 == 0 ? "1" : "0" i % 2 == 0 i % 2 i 2 0 "1" "0" sb2.append(i % 2 != 0 ? "1" : "0") sb2.append sb2 i % 2 != 0 ? "1" : "0" i % 2 != 0 i % 2 i 2 0 "1" "0" ans1 = sb1.toString() ans1 sb1.toString() sb1.toString sb1 ans2 = sb2.toString() ans2 sb2.toString() sb2.toString sb2 int d1 = distance(s, ans1); d1 distance(s, ans1) distance s ans1 int d2 = distance(s, ans2); d2 distance(s, ans2) distance s ans2 System.out.println(d1 > d2 ? d2 : d1) System.out.println System.out System System.out d1 > d2 ? d2 : d1 d1 > d2 d1 d2 d2 d1 String args[] args private static int distance(String s, String target) {
        int c = 0;
        char[] s1 = s.toCharArray();
        char[] s2 = target.toCharArray();
        for (int i=0; i < s.length(); i++) {
            if (s1[i] != s2[i])
                c++;
        }
        return c;
    } distance {
        int c = 0;
        char[] s1 = s.toCharArray();
        char[] s2 = target.toCharArray();
        for (int i=0; i < s.length(); i++) {
            if (s1[i] != s2[i])
                c++;
        }
        return c;
    } int c = 0; c 0 char[] s1 = s.toCharArray(); s1 s.toCharArray() s.toCharArray s char[] s2 = target.toCharArray(); s2 target.toCharArray() target.toCharArray target for (int i=0; i < s.length(); i++) {
            if (s1[i] != s2[i])
                c++;
        } int i=0; int i=0; i 0 i < s.length() i s.length() s.length s i++ i++ i {
            if (s1[i] != s2[i])
                c++;
        } {
            if (s1[i] != s2[i])
                c++;
        } if (s1[i] != s2[i])
                c++; s1[i] != s2[i] s1[i] s1 i s2[i] s2 i c++ c return c; c String s s String target target public class Main {

    private static Scanner sc = new Scanner(System.in);

    public static void main(String args[]) {

        String s = sc.nextLine();

        int l = s.length();

        String ans1, ans2;

        StringBuilder sb1 = new StringBuilder();
        StringBuilder sb2 = new StringBuilder();

        for (int i=0; i < l; i++) {
            sb1.append(i % 2 == 0 ? "1" : "0");
            sb2.append(i % 2 != 0 ? "1" : "0");
        }

        ans1 = sb1.toString();
        ans2 = sb2.toString();

        int d1 = distance(s, ans1);
        int d2 = distance(s, ans2);

        System.out.println(d1 > d2 ? d2 : d1);

    }

    private static int distance(String s, String target) {
        int c = 0;
        char[] s1 = s.toCharArray();
        char[] s2 = target.toCharArray();
        for (int i=0; i < s.length(); i++) {
            if (s1[i] != s2[i])
                c++;
        }
        return c;
    }

} public class Main {

    private static Scanner sc = new Scanner(System.in);

    public static void main(String args[]) {

        String s = sc.nextLine();

        int l = s.length();

        String ans1, ans2;

        StringBuilder sb1 = new StringBuilder();
        StringBuilder sb2 = new StringBuilder();

        for (int i=0; i < l; i++) {
            sb1.append(i % 2 == 0 ? "1" : "0");
            sb2.append(i % 2 != 0 ? "1" : "0");
        }

        ans1 = sb1.toString();
        ans2 = sb2.toString();

        int d1 = distance(s, ans1);
        int d2 = distance(s, ans2);

        System.out.println(d1 > d2 ? d2 : d1);

    }

    private static int distance(String s, String target) {
        int c = 0;
        char[] s1 = s.toCharArray();
        char[] s2 = target.toCharArray();
        for (int i=0; i < s.length(); i++) {
            if (s1[i] != s2[i])
                c++;
        }
        return c;
    }

} Main
import java.util.*;

public class Main {

    private static Scanner sc = new Scanner(System.in);

    public static void main(String args[]) {

        String s = sc.nextLine();

        int l = s.length();

        String ans1, ans2;

        StringBuilder sb1 = new StringBuilder();
        StringBuilder sb2 = new StringBuilder();

        for (int i=0; i < l; i++) {
            sb1.append(i % 2 == 0 ? "1" : "0");
            sb2.append(i % 2 != 0 ? "1" : "0");
        }

        ans1 = sb1.toString();
        ans2 = sb2.toString();

        int d1 = distance(s, ans1);
        int d2 = distance(s, ans2);

        System.out.println(d1 > d2 ? d2 : d1);

    }

    private static int distance(String s, String target) {
        int c = 0;
        char[] s1 = s.toCharArray();
        char[] s2 = target.toCharArray();
        for (int i=0; i < s.length(); i++) {
            if (s1[i] != s2[i])
                c++;
        }
        return c;
    }

}
