import java.util.*;

public class Main {

    public static void main(String[] args) {
        // write your code here
        Scanner sc = new Scanner(System.in);

        String[] s = sc.next().split("");

        StringBuilder builder = new StringBuilder();
        for (int i = 0; i < s.length; i++) {
            builder.append(i % 2 == 0 ? 0 : 1);
        }
        String[] pattern1 = builder.toString().split("");
        builder = new StringBuilder();
        for (int i = 0; i < s.length; i++) {
            builder.append(i % 2 == 0 ? 1 : 0);
        }
        String[] pattern2 = builder.toString().split("");

        int count1 = 0;
        int count2 = 0;

        for (int i = 0; i < s.length; i++) {
            if (!s[i].equals(pattern1[i])) {
                count1++;
            }
            if (!s[i].equals(pattern2[i])) {
                count2++;
            }
        }

        System.out.println(Math.min(count1, count2));
    }
} import java.util.*; util.* java public class Main {

    public static void main(String[] args) {
        // write your code here
        Scanner sc = new Scanner(System.in);

        String[] s = sc.next().split("");

        StringBuilder builder = new StringBuilder();
        for (int i = 0; i < s.length; i++) {
            builder.append(i % 2 == 0 ? 0 : 1);
        }
        String[] pattern1 = builder.toString().split("");
        builder = new StringBuilder();
        for (int i = 0; i < s.length; i++) {
            builder.append(i % 2 == 0 ? 1 : 0);
        }
        String[] pattern2 = builder.toString().split("");

        int count1 = 0;
        int count2 = 0;

        for (int i = 0; i < s.length; i++) {
            if (!s[i].equals(pattern1[i])) {
                count1++;
            }
            if (!s[i].equals(pattern2[i])) {
                count2++;
            }
        }

        System.out.println(Math.min(count1, count2));
    }
} Main public static void main(String[] args) {
        // write your code here
        Scanner sc = new Scanner(System.in);

        String[] s = sc.next().split("");

        StringBuilder builder = new StringBuilder();
        for (int i = 0; i < s.length; i++) {
            builder.append(i % 2 == 0 ? 0 : 1);
        }
        String[] pattern1 = builder.toString().split("");
        builder = new StringBuilder();
        for (int i = 0; i < s.length; i++) {
            builder.append(i % 2 == 0 ? 1 : 0);
        }
        String[] pattern2 = builder.toString().split("");

        int count1 = 0;
        int count2 = 0;

        for (int i = 0; i < s.length; i++) {
            if (!s[i].equals(pattern1[i])) {
                count1++;
            }
            if (!s[i].equals(pattern2[i])) {
                count2++;
            }
        }

        System.out.println(Math.min(count1, count2));
    } main {
        // write your code here
        Scanner sc = new Scanner(System.in);

        String[] s = sc.next().split("");

        StringBuilder builder = new StringBuilder();
        for (int i = 0; i < s.length; i++) {
            builder.append(i % 2 == 0 ? 0 : 1);
        }
        String[] pattern1 = builder.toString().split("");
        builder = new StringBuilder();
        for (int i = 0; i < s.length; i++) {
            builder.append(i % 2 == 0 ? 1 : 0);
        }
        String[] pattern2 = builder.toString().split("");

        int count1 = 0;
        int count2 = 0;

        for (int i = 0; i < s.length; i++) {
            if (!s[i].equals(pattern1[i])) {
                count1++;
            }
            if (!s[i].equals(pattern2[i])) {
                count2++;
            }
        }

        System.out.println(Math.min(count1, count2));
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String[] s = sc.next().split(""); s sc.next().split("") sc.next().split sc.next() sc.next sc "" StringBuilder builder = new StringBuilder(); builder new StringBuilder() for (int i = 0; i < s.length; i++) {
            builder.append(i % 2 == 0 ? 0 : 1);
        } int i = 0; int i = 0; i 0 i < s.length i s.length s s.length i++ i++ i {
            builder.append(i % 2 == 0 ? 0 : 1);
        } {
            builder.append(i % 2 == 0 ? 0 : 1);
        } builder.append(i % 2 == 0 ? 0 : 1) builder.append builder i % 2 == 0 ? 0 : 1 i % 2 == 0 i % 2 i 2 0 0 1 String[] pattern1 = builder.toString().split(""); pattern1 builder.toString().split("") builder.toString().split builder.toString() builder.toString builder "" builder = new StringBuilder() builder new StringBuilder() for (int i = 0; i < s.length; i++) {
            builder.append(i % 2 == 0 ? 1 : 0);
        } int i = 0; int i = 0; i 0 i < s.length i s.length s s.length i++ i++ i {
            builder.append(i % 2 == 0 ? 1 : 0);
        } {
            builder.append(i % 2 == 0 ? 1 : 0);
        } builder.append(i % 2 == 0 ? 1 : 0) builder.append builder i % 2 == 0 ? 1 : 0 i % 2 == 0 i % 2 i 2 0 1 0 String[] pattern2 = builder.toString().split(""); pattern2 builder.toString().split("") builder.toString().split builder.toString() builder.toString builder "" int count1 = 0; count1 0 int count2 = 0; count2 0 for (int i = 0; i < s.length; i++) {
            if (!s[i].equals(pattern1[i])) {
                count1++;
            }
            if (!s[i].equals(pattern2[i])) {
                count2++;
            }
        } int i = 0; int i = 0; i 0 i < s.length i s.length s s.length i++ i++ i {
            if (!s[i].equals(pattern1[i])) {
                count1++;
            }
            if (!s[i].equals(pattern2[i])) {
                count2++;
            }
        } {
            if (!s[i].equals(pattern1[i])) {
                count1++;
            }
            if (!s[i].equals(pattern2[i])) {
                count2++;
            }
        } if (!s[i].equals(pattern1[i])) {
                count1++;
            } !s[i].equals(pattern1[i]) s[i].equals(pattern1[i]) s[i].equals s[i] s i pattern1[i] pattern1 i {
                count1++;
            } count1++ count1 if (!s[i].equals(pattern2[i])) {
                count2++;
            } !s[i].equals(pattern2[i]) s[i].equals(pattern2[i]) s[i].equals s[i] s i pattern2[i] pattern2 i {
                count2++;
            } count2++ count2 System.out.println(Math.min(count1, count2)) System.out.println System.out System System.out Math.min(count1, count2) Math.min Math count1 count2 String[] args args public class Main {

    public static void main(String[] args) {
        // write your code here
        Scanner sc = new Scanner(System.in);

        String[] s = sc.next().split("");

        StringBuilder builder = new StringBuilder();
        for (int i = 0; i < s.length; i++) {
            builder.append(i % 2 == 0 ? 0 : 1);
        }
        String[] pattern1 = builder.toString().split("");
        builder = new StringBuilder();
        for (int i = 0; i < s.length; i++) {
            builder.append(i % 2 == 0 ? 1 : 0);
        }
        String[] pattern2 = builder.toString().split("");

        int count1 = 0;
        int count2 = 0;

        for (int i = 0; i < s.length; i++) {
            if (!s[i].equals(pattern1[i])) {
                count1++;
            }
            if (!s[i].equals(pattern2[i])) {
                count2++;
            }
        }

        System.out.println(Math.min(count1, count2));
    }
} public class Main {

    public static void main(String[] args) {
        // write your code here
        Scanner sc = new Scanner(System.in);

        String[] s = sc.next().split("");

        StringBuilder builder = new StringBuilder();
        for (int i = 0; i < s.length; i++) {
            builder.append(i % 2 == 0 ? 0 : 1);
        }
        String[] pattern1 = builder.toString().split("");
        builder = new StringBuilder();
        for (int i = 0; i < s.length; i++) {
            builder.append(i % 2 == 0 ? 1 : 0);
        }
        String[] pattern2 = builder.toString().split("");

        int count1 = 0;
        int count2 = 0;

        for (int i = 0; i < s.length; i++) {
            if (!s[i].equals(pattern1[i])) {
                count1++;
            }
            if (!s[i].equals(pattern2[i])) {
                count2++;
            }
        }

        System.out.println(Math.min(count1, count2));
    }
} Main
import java.util.*;

public class Main {

    public static void main(String[] args) {
        // write your code here
        Scanner sc = new Scanner(System.in);

        String[] s = sc.next().split("");

        StringBuilder builder = new StringBuilder();
        for (int i = 0; i < s.length; i++) {
            builder.append(i % 2 == 0 ? 0 : 1);
        }
        String[] pattern1 = builder.toString().split("");
        builder = new StringBuilder();
        for (int i = 0; i < s.length; i++) {
            builder.append(i % 2 == 0 ? 1 : 0);
        }
        String[] pattern2 = builder.toString().split("");

        int count1 = 0;
        int count2 = 0;

        for (int i = 0; i < s.length; i++) {
            if (!s[i].equals(pattern1[i])) {
                count1++;
            }
            if (!s[i].equals(pattern2[i])) {
                count2++;
            }
        }

        System.out.println(Math.min(count1, count2));
    }
}