import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        String S = sc.next();

        int ans = solve(S);
        System.out.println(ans);

    }

    private static int solve(String s) {
        int ans = 0;
        char[] sn = s.toCharArray();
        for (int i = 1; i < s.length(); i++) {
            if (sn[i - 1] == sn[i]) {
                ans++;
                sn[i] = sn[i] == '0' ? '1' : '0';
            }
        }
        return ans;
    }

} 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 ans = solve(S);
        System.out.println(ans);

    }

    private static int solve(String s) {
        int ans = 0;
        char[] sn = s.toCharArray();
        for (int i = 1; i < s.length(); i++) {
            if (sn[i - 1] == sn[i]) {
                ans++;
                sn[i] = sn[i] == '0' ? '1' : '0';
            }
        }
        return ans;
    }

} Main public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        String S = sc.next();

        int ans = solve(S);
        System.out.println(ans);

    } main {

        Scanner sc = new Scanner(System.in);
        String S = sc.next();

        int ans = solve(S);
        System.out.println(ans);

    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.next(); S sc.next() sc.next sc int ans = solve(S); ans solve(S) solve S System.out.println(ans) System.out.println System.out System System.out ans String[] args args private static int solve(String s) {
        int ans = 0;
        char[] sn = s.toCharArray();
        for (int i = 1; i < s.length(); i++) {
            if (sn[i - 1] == sn[i]) {
                ans++;
                sn[i] = sn[i] == '0' ? '1' : '0';
            }
        }
        return ans;
    } solve {
        int ans = 0;
        char[] sn = s.toCharArray();
        for (int i = 1; i < s.length(); i++) {
            if (sn[i - 1] == sn[i]) {
                ans++;
                sn[i] = sn[i] == '0' ? '1' : '0';
            }
        }
        return ans;
    } int ans = 0; ans 0 char[] sn = s.toCharArray(); sn s.toCharArray() s.toCharArray s for (int i = 1; i < s.length(); i++) {
            if (sn[i - 1] == sn[i]) {
                ans++;
                sn[i] = sn[i] == '0' ? '1' : '0';
            }
        } int i = 1; int i = 1; i 1 i < s.length() i s.length() s.length s i++ i++ i {
            if (sn[i - 1] == sn[i]) {
                ans++;
                sn[i] = sn[i] == '0' ? '1' : '0';
            }
        } {
            if (sn[i - 1] == sn[i]) {
                ans++;
                sn[i] = sn[i] == '0' ? '1' : '0';
            }
        } if (sn[i - 1] == sn[i]) {
                ans++;
                sn[i] = sn[i] == '0' ? '1' : '0';
            } sn[i - 1] == sn[i] sn[i - 1] sn i - 1 i 1 sn[i] sn i {
                ans++;
                sn[i] = sn[i] == '0' ? '1' : '0';
            } ans++ ans sn[i] = sn[i] == '0' ? '1' : '0' sn[i] sn i sn[i] == '0' ? '1' : '0' sn[i] == '0' sn[i] sn i '0' '1' '0' return ans; ans String s s public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        String S = sc.next();

        int ans = solve(S);
        System.out.println(ans);

    }

    private static int solve(String s) {
        int ans = 0;
        char[] sn = s.toCharArray();
        for (int i = 1; i < s.length(); i++) {
            if (sn[i - 1] == sn[i]) {
                ans++;
                sn[i] = sn[i] == '0' ? '1' : '0';
            }
        }
        return ans;
    }

} public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        String S = sc.next();

        int ans = solve(S);
        System.out.println(ans);

    }

    private static int solve(String s) {
        int ans = 0;
        char[] sn = s.toCharArray();
        for (int i = 1; i < s.length(); i++) {
            if (sn[i - 1] == sn[i]) {
                ans++;
                sn[i] = sn[i] == '0' ? '1' : '0';
            }
        }
        return ans;
    }

} 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 ans = solve(S);
        System.out.println(ans);

    }

    private static int solve(String s) {
        int ans = 0;
        char[] sn = s.toCharArray();
        for (int i = 1; i < s.length(); i++) {
            if (sn[i - 1] == sn[i]) {
                ans++;
                sn[i] = sn[i] == '0' ? '1' : '0';
            }
        }
        return ans;
    }

}
