import java.lang.Math;
import java.util.Scanner;

class Main {
    public static void main(String[] args) {
        final Scanner scanner = new Scanner(System.in);
        final String S = scanner.nextLine();

        final char[] order1 = { '0', '1' };
        final char[] order2 = { '1', '0' };

        int count1 = 0;
        int count2 = 0;

        final int n = S.length();
        for (int i = 0; i < n; i++) {
            int c = S.charAt(i);
            int c1 = order1[i % 2];
            int c2 = order2[i % 2];
            if (c1 != c) {
                count1++;
            }
            if (c2 != c) {
                count2++;
            }
        }

        System.out.println(Math.min(count1, count2));
    }
} import java.lang.Math; Math java.lang import java.util.Scanner; Scanner java.util class Main {
    public static void main(String[] args) {
        final Scanner scanner = new Scanner(System.in);
        final String S = scanner.nextLine();

        final char[] order1 = { '0', '1' };
        final char[] order2 = { '1', '0' };

        int count1 = 0;
        int count2 = 0;

        final int n = S.length();
        for (int i = 0; i < n; i++) {
            int c = S.charAt(i);
            int c1 = order1[i % 2];
            int c2 = order2[i % 2];
            if (c1 != c) {
                count1++;
            }
            if (c2 != c) {
                count2++;
            }
        }

        System.out.println(Math.min(count1, count2));
    }
} Main public static void main(String[] args) {
        final Scanner scanner = new Scanner(System.in);
        final String S = scanner.nextLine();

        final char[] order1 = { '0', '1' };
        final char[] order2 = { '1', '0' };

        int count1 = 0;
        int count2 = 0;

        final int n = S.length();
        for (int i = 0; i < n; i++) {
            int c = S.charAt(i);
            int c1 = order1[i % 2];
            int c2 = order2[i % 2];
            if (c1 != c) {
                count1++;
            }
            if (c2 != c) {
                count2++;
            }
        }

        System.out.println(Math.min(count1, count2));
    } main {
        final Scanner scanner = new Scanner(System.in);
        final String S = scanner.nextLine();

        final char[] order1 = { '0', '1' };
        final char[] order2 = { '1', '0' };

        int count1 = 0;
        int count2 = 0;

        final int n = S.length();
        for (int i = 0; i < n; i++) {
            int c = S.charAt(i);
            int c1 = order1[i % 2];
            int c2 = order2[i % 2];
            if (c1 != c) {
                count1++;
            }
            if (c2 != c) {
                count2++;
            }
        }

        System.out.println(Math.min(count1, count2));
    } final Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) final String S = scanner.nextLine(); S scanner.nextLine() scanner.nextLine scanner final char[] order1 = { '0', '1' }; order1 { '0', '1' } '0' '1' final char[] order2 = { '1', '0' }; order2 { '1', '0' } '1' '0' int count1 = 0; count1 0 int count2 = 0; count2 0 final int n = S.length(); n S.length() S.length S for (int i = 0; i < n; i++) {
            int c = S.charAt(i);
            int c1 = order1[i % 2];
            int c2 = order2[i % 2];
            if (c1 != c) {
                count1++;
            }
            if (c2 != c) {
                count2++;
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            int c = S.charAt(i);
            int c1 = order1[i % 2];
            int c2 = order2[i % 2];
            if (c1 != c) {
                count1++;
            }
            if (c2 != c) {
                count2++;
            }
        } {
            int c = S.charAt(i);
            int c1 = order1[i % 2];
            int c2 = order2[i % 2];
            if (c1 != c) {
                count1++;
            }
            if (c2 != c) {
                count2++;
            }
        } int c = S.charAt(i); c S.charAt(i) S.charAt S i int c1 = order1[i % 2]; c1 order1[i % 2] order1 i % 2 i 2 int c2 = order2[i % 2]; c2 order2[i % 2] order2 i % 2 i 2 if (c1 != c) {
                count1++;
            } c1 != c c1 c {
                count1++;
            } count1++ count1 if (c2 != c) {
                count2++;
            } c2 != c c2 c {
                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
import java.lang.Math;
import java.util.Scanner;

class Main {
    public static void main(String[] args) {
        final Scanner scanner = new Scanner(System.in);
        final String S = scanner.nextLine();

        final char[] order1 = { '0', '1' };
        final char[] order2 = { '1', '0' };

        int count1 = 0;
        int count2 = 0;

        final int n = S.length();
        for (int i = 0; i < n; i++) {
            int c = S.charAt(i);
            int c1 = order1[i % 2];
            int c2 = order2[i % 2];
            if (c1 != c) {
                count1++;
            }
            if (c2 != c) {
                count2++;
            }
        }

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