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 count1 = countToZeroFirst(S);
        int count2 = countToOneFirst(S);

        if (count1 < count2) {
            System.out.println(count1);
        }
        else {
            System.out.println(count2);
        }
    }

    private  static int countToZeroFirst(final char[] S) {
        int changeCount = 0;
        for (int i = 0; i < S.length; i++) {
            if (i % 2 == 0) {
                if (S[i] == '1') {
                    changeCount++;
                }
            }
            else {
                if (S[i] == '0') {
                    changeCount++;
                }
            }
        }
        return changeCount;
    }
    private  static int countToOneFirst(final char[] S) {
        int changeCount = 0;
        for (int i = 0; i < S.length; i++) {
            if (i % 2 == 0) {
                if (S[i] == '0') {
                    changeCount++;
                }
            }
            else {
                if (S[i] == '1') {
                    changeCount++;
                }
            }
        }
        return changeCount;
    }
} 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 count1 = countToZeroFirst(S);
        int count2 = countToOneFirst(S);

        if (count1 < count2) {
            System.out.println(count1);
        }
        else {
            System.out.println(count2);
        }
    }

    private  static int countToZeroFirst(final char[] S) {
        int changeCount = 0;
        for (int i = 0; i < S.length; i++) {
            if (i % 2 == 0) {
                if (S[i] == '1') {
                    changeCount++;
                }
            }
            else {
                if (S[i] == '0') {
                    changeCount++;
                }
            }
        }
        return changeCount;
    }
    private  static int countToOneFirst(final char[] S) {
        int changeCount = 0;
        for (int i = 0; i < S.length; i++) {
            if (i % 2 == 0) {
                if (S[i] == '0') {
                    changeCount++;
                }
            }
            else {
                if (S[i] == '1') {
                    changeCount++;
                }
            }
        }
        return changeCount;
    }
} 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 count1 = countToZeroFirst(S);
        int count2 = countToOneFirst(S);

        if (count1 < count2) {
            System.out.println(count1);
        }
        else {
            System.out.println(count2);
        }
    } 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 count1 = countToZeroFirst(S);
        int count2 = countToOneFirst(S);

        if (count1 < count2) {
            System.out.println(count1);
        }
        else {
            System.out.println(count2);
        }
    } 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 count1 = countToZeroFirst(S); count1 countToZeroFirst(S) countToZeroFirst S int count2 = countToOneFirst(S); count2 countToOneFirst(S) countToOneFirst S if (count1 < count2) {
            System.out.println(count1);
        }
        else {
            System.out.println(count2);
        } count1 < count2 count1 count2 {
            System.out.println(count1);
        } System.out.println(count1) System.out.println System.out System System.out count1 {
            System.out.println(count2);
        } System.out.println(count2) System.out.println System.out System System.out count2 String[] args args private  static int countToZeroFirst(final char[] S) {
        int changeCount = 0;
        for (int i = 0; i < S.length; i++) {
            if (i % 2 == 0) {
                if (S[i] == '1') {
                    changeCount++;
                }
            }
            else {
                if (S[i] == '0') {
                    changeCount++;
                }
            }
        }
        return changeCount;
    } countToZeroFirst {
        int changeCount = 0;
        for (int i = 0; i < S.length; i++) {
            if (i % 2 == 0) {
                if (S[i] == '1') {
                    changeCount++;
                }
            }
            else {
                if (S[i] == '0') {
                    changeCount++;
                }
            }
        }
        return changeCount;
    } int changeCount = 0; changeCount 0 for (int i = 0; i < S.length; i++) {
            if (i % 2 == 0) {
                if (S[i] == '1') {
                    changeCount++;
                }
            }
            else {
                if (S[i] == '0') {
                    changeCount++;
                }
            }
        } int i = 0; int i = 0; i 0 i < S.length i S.length S S.length i++ i++ i {
            if (i % 2 == 0) {
                if (S[i] == '1') {
                    changeCount++;
                }
            }
            else {
                if (S[i] == '0') {
                    changeCount++;
                }
            }
        } {
            if (i % 2 == 0) {
                if (S[i] == '1') {
                    changeCount++;
                }
            }
            else {
                if (S[i] == '0') {
                    changeCount++;
                }
            }
        } if (i % 2 == 0) {
                if (S[i] == '1') {
                    changeCount++;
                }
            }
            else {
                if (S[i] == '0') {
                    changeCount++;
                }
            } i % 2 == 0 i % 2 i 2 0 {
                if (S[i] == '1') {
                    changeCount++;
                }
            } if (S[i] == '1') {
                    changeCount++;
                } S[i] == '1' S[i] S i '1' {
                    changeCount++;
                } changeCount++ changeCount {
                if (S[i] == '0') {
                    changeCount++;
                }
            } if (S[i] == '0') {
                    changeCount++;
                } S[i] == '0' S[i] S i '0' {
                    changeCount++;
                } changeCount++ changeCount return changeCount; changeCount final char[] S S private  static int countToOneFirst(final char[] S) {
        int changeCount = 0;
        for (int i = 0; i < S.length; i++) {
            if (i % 2 == 0) {
                if (S[i] == '0') {
                    changeCount++;
                }
            }
            else {
                if (S[i] == '1') {
                    changeCount++;
                }
            }
        }
        return changeCount;
    } countToOneFirst {
        int changeCount = 0;
        for (int i = 0; i < S.length; i++) {
            if (i % 2 == 0) {
                if (S[i] == '0') {
                    changeCount++;
                }
            }
            else {
                if (S[i] == '1') {
                    changeCount++;
                }
            }
        }
        return changeCount;
    } int changeCount = 0; changeCount 0 for (int i = 0; i < S.length; i++) {
            if (i % 2 == 0) {
                if (S[i] == '0') {
                    changeCount++;
                }
            }
            else {
                if (S[i] == '1') {
                    changeCount++;
                }
            }
        } int i = 0; int i = 0; i 0 i < S.length i S.length S S.length i++ i++ i {
            if (i % 2 == 0) {
                if (S[i] == '0') {
                    changeCount++;
                }
            }
            else {
                if (S[i] == '1') {
                    changeCount++;
                }
            }
        } {
            if (i % 2 == 0) {
                if (S[i] == '0') {
                    changeCount++;
                }
            }
            else {
                if (S[i] == '1') {
                    changeCount++;
                }
            }
        } if (i % 2 == 0) {
                if (S[i] == '0') {
                    changeCount++;
                }
            }
            else {
                if (S[i] == '1') {
                    changeCount++;
                }
            } i % 2 == 0 i % 2 i 2 0 {
                if (S[i] == '0') {
                    changeCount++;
                }
            } if (S[i] == '0') {
                    changeCount++;
                } S[i] == '0' S[i] S i '0' {
                    changeCount++;
                } changeCount++ changeCount {
                if (S[i] == '1') {
                    changeCount++;
                }
            } if (S[i] == '1') {
                    changeCount++;
                } S[i] == '1' S[i] S i '1' {
                    changeCount++;
                } changeCount++ changeCount return changeCount; changeCount final char[] S S 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 count1 = countToZeroFirst(S);
        int count2 = countToOneFirst(S);

        if (count1 < count2) {
            System.out.println(count1);
        }
        else {
            System.out.println(count2);
        }
    }

    private  static int countToZeroFirst(final char[] S) {
        int changeCount = 0;
        for (int i = 0; i < S.length; i++) {
            if (i % 2 == 0) {
                if (S[i] == '1') {
                    changeCount++;
                }
            }
            else {
                if (S[i] == '0') {
                    changeCount++;
                }
            }
        }
        return changeCount;
    }
    private  static int countToOneFirst(final char[] S) {
        int changeCount = 0;
        for (int i = 0; i < S.length; i++) {
            if (i % 2 == 0) {
                if (S[i] == '0') {
                    changeCount++;
                }
            }
            else {
                if (S[i] == '1') {
                    changeCount++;
                }
            }
        }
        return changeCount;
    }
} 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 count1 = countToZeroFirst(S);
        int count2 = countToOneFirst(S);

        if (count1 < count2) {
            System.out.println(count1);
        }
        else {
            System.out.println(count2);
        }
    }

    private  static int countToZeroFirst(final char[] S) {
        int changeCount = 0;
        for (int i = 0; i < S.length; i++) {
            if (i % 2 == 0) {
                if (S[i] == '1') {
                    changeCount++;
                }
            }
            else {
                if (S[i] == '0') {
                    changeCount++;
                }
            }
        }
        return changeCount;
    }
    private  static int countToOneFirst(final char[] S) {
        int changeCount = 0;
        for (int i = 0; i < S.length; i++) {
            if (i % 2 == 0) {
                if (S[i] == '0') {
                    changeCount++;
                }
            }
            else {
                if (S[i] == '1') {
                    changeCount++;
                }
            }
        }
        return changeCount;
    }
} 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 count1 = countToZeroFirst(S);
        int count2 = countToOneFirst(S);

        if (count1 < count2) {
            System.out.println(count1);
        }
        else {
            System.out.println(count2);
        }
    }

    private  static int countToZeroFirst(final char[] S) {
        int changeCount = 0;
        for (int i = 0; i < S.length; i++) {
            if (i % 2 == 0) {
                if (S[i] == '1') {
                    changeCount++;
                }
            }
            else {
                if (S[i] == '0') {
                    changeCount++;
                }
            }
        }
        return changeCount;
    }
    private  static int countToOneFirst(final char[] S) {
        int changeCount = 0;
        for (int i = 0; i < S.length; i++) {
            if (i % 2 == 0) {
                if (S[i] == '0') {
                    changeCount++;
                }
            }
            else {
                if (S[i] == '1') {
                    changeCount++;
                }
            }
        }
        return changeCount;
    }
}
