
import java.util.Scanner;

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

        int resultA = 0;
        int resultB = 0;

        for (int i = 0; i < chars.length; i++) {
            if (i % 2 == 0) {
                if (chars[i] == '0') {
                    resultA++;
                } else {
                    resultB++;
                }
            } else {
                if (chars[i] == '1') {
                    resultA++;
                } else {
                    resultB++;
                }
            }
        }

        System.out.println(Math.min(resultA, resultB));
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(final String[] args) {
        final Scanner scanner = new Scanner(System.in);
        final char[] chars = scanner.nextLine().toCharArray();

        int resultA = 0;
        int resultB = 0;

        for (int i = 0; i < chars.length; i++) {
            if (i % 2 == 0) {
                if (chars[i] == '0') {
                    resultA++;
                } else {
                    resultB++;
                }
            } else {
                if (chars[i] == '1') {
                    resultA++;
                } else {
                    resultB++;
                }
            }
        }

        System.out.println(Math.min(resultA, resultB));
    }
} Main public static void main(final String[] args) {
        final Scanner scanner = new Scanner(System.in);
        final char[] chars = scanner.nextLine().toCharArray();

        int resultA = 0;
        int resultB = 0;

        for (int i = 0; i < chars.length; i++) {
            if (i % 2 == 0) {
                if (chars[i] == '0') {
                    resultA++;
                } else {
                    resultB++;
                }
            } else {
                if (chars[i] == '1') {
                    resultA++;
                } else {
                    resultB++;
                }
            }
        }

        System.out.println(Math.min(resultA, resultB));
    } main {
        final Scanner scanner = new Scanner(System.in);
        final char[] chars = scanner.nextLine().toCharArray();

        int resultA = 0;
        int resultB = 0;

        for (int i = 0; i < chars.length; i++) {
            if (i % 2 == 0) {
                if (chars[i] == '0') {
                    resultA++;
                } else {
                    resultB++;
                }
            } else {
                if (chars[i] == '1') {
                    resultA++;
                } else {
                    resultB++;
                }
            }
        }

        System.out.println(Math.min(resultA, resultB));
    } final Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) final char[] chars = scanner.nextLine().toCharArray(); chars scanner.nextLine().toCharArray() scanner.nextLine().toCharArray scanner.nextLine() scanner.nextLine scanner int resultA = 0; resultA 0 int resultB = 0; resultB 0 for (int i = 0; i < chars.length; i++) {
            if (i % 2 == 0) {
                if (chars[i] == '0') {
                    resultA++;
                } else {
                    resultB++;
                }
            } else {
                if (chars[i] == '1') {
                    resultA++;
                } else {
                    resultB++;
                }
            }
        } int i = 0; int i = 0; i 0 i < chars.length i chars.length chars chars.length i++ i++ i {
            if (i % 2 == 0) {
                if (chars[i] == '0') {
                    resultA++;
                } else {
                    resultB++;
                }
            } else {
                if (chars[i] == '1') {
                    resultA++;
                } else {
                    resultB++;
                }
            }
        } {
            if (i % 2 == 0) {
                if (chars[i] == '0') {
                    resultA++;
                } else {
                    resultB++;
                }
            } else {
                if (chars[i] == '1') {
                    resultA++;
                } else {
                    resultB++;
                }
            }
        } if (i % 2 == 0) {
                if (chars[i] == '0') {
                    resultA++;
                } else {
                    resultB++;
                }
            } else {
                if (chars[i] == '1') {
                    resultA++;
                } else {
                    resultB++;
                }
            } i % 2 == 0 i % 2 i 2 0 {
                if (chars[i] == '0') {
                    resultA++;
                } else {
                    resultB++;
                }
            } if (chars[i] == '0') {
                    resultA++;
                } else {
                    resultB++;
                } chars[i] == '0' chars[i] chars i '0' {
                    resultA++;
                } resultA++ resultA {
                    resultB++;
                } resultB++ resultB {
                if (chars[i] == '1') {
                    resultA++;
                } else {
                    resultB++;
                }
            } if (chars[i] == '1') {
                    resultA++;
                } else {
                    resultB++;
                } chars[i] == '1' chars[i] chars i '1' {
                    resultA++;
                } resultA++ resultA {
                    resultB++;
                } resultB++ resultB System.out.println(Math.min(resultA, resultB)) System.out.println System.out System System.out Math.min(resultA, resultB) Math.min Math resultA resultB final String[] args args public class Main {
    public static void main(final String[] args) {
        final Scanner scanner = new Scanner(System.in);
        final char[] chars = scanner.nextLine().toCharArray();

        int resultA = 0;
        int resultB = 0;

        for (int i = 0; i < chars.length; i++) {
            if (i % 2 == 0) {
                if (chars[i] == '0') {
                    resultA++;
                } else {
                    resultB++;
                }
            } else {
                if (chars[i] == '1') {
                    resultA++;
                } else {
                    resultB++;
                }
            }
        }

        System.out.println(Math.min(resultA, resultB));
    }
} public class Main {
    public static void main(final String[] args) {
        final Scanner scanner = new Scanner(System.in);
        final char[] chars = scanner.nextLine().toCharArray();

        int resultA = 0;
        int resultB = 0;

        for (int i = 0; i < chars.length; i++) {
            if (i % 2 == 0) {
                if (chars[i] == '0') {
                    resultA++;
                } else {
                    resultB++;
                }
            } else {
                if (chars[i] == '1') {
                    resultA++;
                } else {
                    resultB++;
                }
            }
        }

        System.out.println(Math.min(resultA, resultB));
    }
} Main

import java.util.Scanner;

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

        int resultA = 0;
        int resultB = 0;

        for (int i = 0; i < chars.length; i++) {
            if (i % 2 == 0) {
                if (chars[i] == '0') {
                    resultA++;
                } else {
                    resultB++;
                }
            } else {
                if (chars[i] == '1') {
                    resultA++;
                } else {
                    resultB++;
                }
            }
        }

        System.out.println(Math.min(resultA, resultB));
    }
}
