import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String input = sc.nextLine();
        int length = input.length();
        char[] S = new char[length];
        for (int i = 0; i < length; i++) {
            S[i] = input.charAt(i);
        }

        int ans = 0;
        for (int i = 1; i < length; i++) {
            if(S[i-1] == S[i]) {
                ans++;
                if (S[i] == '0') {
                    S[i] = '1';
                }
                else {
                    S[i] = '0';
                }
            }
        }

        System.out.println(ans);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String input = sc.nextLine();
        int length = input.length();
        char[] S = new char[length];
        for (int i = 0; i < length; i++) {
            S[i] = input.charAt(i);
        }

        int ans = 0;
        for (int i = 1; i < length; i++) {
            if(S[i-1] == S[i]) {
                ans++;
                if (S[i] == '0') {
                    S[i] = '1';
                }
                else {
                    S[i] = '0';
                }
            }
        }

        System.out.println(ans);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String input = sc.nextLine();
        int length = input.length();
        char[] S = new char[length];
        for (int i = 0; i < length; i++) {
            S[i] = input.charAt(i);
        }

        int ans = 0;
        for (int i = 1; i < length; i++) {
            if(S[i-1] == S[i]) {
                ans++;
                if (S[i] == '0') {
                    S[i] = '1';
                }
                else {
                    S[i] = '0';
                }
            }
        }

        System.out.println(ans);
    } main {
        Scanner sc = new Scanner(System.in);
        String input = sc.nextLine();
        int length = input.length();
        char[] S = new char[length];
        for (int i = 0; i < length; i++) {
            S[i] = input.charAt(i);
        }

        int ans = 0;
        for (int i = 1; i < length; i++) {
            if(S[i-1] == S[i]) {
                ans++;
                if (S[i] == '0') {
                    S[i] = '1';
                }
                else {
                    S[i] = '0';
                }
            }
        }

        System.out.println(ans);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String input = sc.nextLine(); input sc.nextLine() sc.nextLine sc int length = input.length(); length input.length() input.length input char[] S = new char[length]; S new char[length] length for (int i = 0; i < length; i++) {
            S[i] = input.charAt(i);
        } int i = 0; int i = 0; i 0 i < length i length i++ i++ i {
            S[i] = input.charAt(i);
        } {
            S[i] = input.charAt(i);
        } S[i] = input.charAt(i) S[i] S i input.charAt(i) input.charAt input i int ans = 0; ans 0 for (int i = 1; i < length; i++) {
            if(S[i-1] == S[i]) {
                ans++;
                if (S[i] == '0') {
                    S[i] = '1';
                }
                else {
                    S[i] = '0';
                }
            }
        } int i = 1; int i = 1; i 1 i < length i length i++ i++ i {
            if(S[i-1] == S[i]) {
                ans++;
                if (S[i] == '0') {
                    S[i] = '1';
                }
                else {
                    S[i] = '0';
                }
            }
        } {
            if(S[i-1] == S[i]) {
                ans++;
                if (S[i] == '0') {
                    S[i] = '1';
                }
                else {
                    S[i] = '0';
                }
            }
        } if(S[i-1] == S[i]) {
                ans++;
                if (S[i] == '0') {
                    S[i] = '1';
                }
                else {
                    S[i] = '0';
                }
            } S[i-1] == S[i] S[i-1] S i-1 i 1 S[i] S i {
                ans++;
                if (S[i] == '0') {
                    S[i] = '1';
                }
                else {
                    S[i] = '0';
                }
            } ans++ ans if (S[i] == '0') {
                    S[i] = '1';
                }
                else {
                    S[i] = '0';
                } S[i] == '0' S[i] S i '0' {
                    S[i] = '1';
                } S[i] = '1' S[i] S i '1' {
                    S[i] = '0';
                } S[i] = '0' S[i] S i '0' System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String input = sc.nextLine();
        int length = input.length();
        char[] S = new char[length];
        for (int i = 0; i < length; i++) {
            S[i] = input.charAt(i);
        }

        int ans = 0;
        for (int i = 1; i < length; i++) {
            if(S[i-1] == S[i]) {
                ans++;
                if (S[i] == '0') {
                    S[i] = '1';
                }
                else {
                    S[i] = '0';
                }
            }
        }

        System.out.println(ans);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String input = sc.nextLine();
        int length = input.length();
        char[] S = new char[length];
        for (int i = 0; i < length; i++) {
            S[i] = input.charAt(i);
        }

        int ans = 0;
        for (int i = 1; i < length; i++) {
            if(S[i-1] == S[i]) {
                ans++;
                if (S[i] == '0') {
                    S[i] = '1';
                }
                else {
                    S[i] = '0';
                }
            }
        }

        System.out.println(ans);
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String input = sc.nextLine();
        int length = input.length();
        char[] S = new char[length];
        for (int i = 0; i < length; i++) {
            S[i] = input.charAt(i);
        }

        int ans = 0;
        for (int i = 1; i < length; i++) {
            if(S[i-1] == S[i]) {
                ans++;
                if (S[i] == '0') {
                    S[i] = '1';
                }
                else {
                    S[i] = '0';
                }
            }
        }

        System.out.println(ans);
    }
}
