import java.util.Scanner;

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

        int[] counts = new int[2];
        for (int i = 0; i < s.length(); i++) {
            int c = s.charAt(i) - '0';
            counts[(i + c) % 2]++;
        }

        System.out.println(Math.min(counts[0], counts[1]));
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.next();

        int[] counts = new int[2];
        for (int i = 0; i < s.length(); i++) {
            int c = s.charAt(i) - '0';
            counts[(i + c) % 2]++;
        }

        System.out.println(Math.min(counts[0], counts[1]));
    }
} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.next();

        int[] counts = new int[2];
        for (int i = 0; i < s.length(); i++) {
            int c = s.charAt(i) - '0';
            counts[(i + c) % 2]++;
        }

        System.out.println(Math.min(counts[0], counts[1]));
    } main {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.next();

        int[] counts = new int[2];
        for (int i = 0; i < s.length(); i++) {
            int c = s.charAt(i) - '0';
            counts[(i + c) % 2]++;
        }

        System.out.println(Math.min(counts[0], counts[1]));
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) String s = scanner.next(); s scanner.next() scanner.next scanner int[] counts = new int[2]; counts new int[2] 2 for (int i = 0; i < s.length(); i++) {
            int c = s.charAt(i) - '0';
            counts[(i + c) % 2]++;
        } int i = 0; int i = 0; i 0 i < s.length() i s.length() s.length s i++ i++ i {
            int c = s.charAt(i) - '0';
            counts[(i + c) % 2]++;
        } {
            int c = s.charAt(i) - '0';
            counts[(i + c) % 2]++;
        } int c = s.charAt(i) - '0'; c s.charAt(i) - '0' s.charAt(i) s.charAt s i '0' counts[(i + c) % 2]++ counts[(i + c) % 2] counts (i + c) % 2 (i + c) i c 2 System.out.println(Math.min(counts[0], counts[1])) System.out.println System.out System System.out Math.min(counts[0], counts[1]) Math.min Math counts[0] counts 0 counts[1] counts 1 String[] args args public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.next();

        int[] counts = new int[2];
        for (int i = 0; i < s.length(); i++) {
            int c = s.charAt(i) - '0';
            counts[(i + c) % 2]++;
        }

        System.out.println(Math.min(counts[0], counts[1]));
    }
} public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.next();

        int[] counts = new int[2];
        for (int i = 0; i < s.length(); i++) {
            int c = s.charAt(i) - '0';
            counts[(i + c) % 2]++;
        }

        System.out.println(Math.min(counts[0], counts[1]));
    }
} Main
import java.util.Scanner;

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

        int[] counts = new int[2];
        for (int i = 0; i < s.length(); i++) {
            int c = s.charAt(i) - '0';
            counts[(i + c) % 2]++;
        }

        System.out.println(Math.min(counts[0], counts[1]));
    }
}
