import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String N = sc.next();
        int curr1 = 0, curr2 = 0;
        for (int i = 0; i < N.length(); i++) {
            int c = N.charAt(i) - '0';
            curr1 += c == i % 2 ? 1 : 0;
            curr2 += c == i % 2 ? 0 : 1;
        }
        System.out.println(Math.min(curr1, curr2));
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String N = sc.next();
        int curr1 = 0, curr2 = 0;
        for (int i = 0; i < N.length(); i++) {
            int c = N.charAt(i) - '0';
            curr1 += c == i % 2 ? 1 : 0;
            curr2 += c == i % 2 ? 0 : 1;
        }
        System.out.println(Math.min(curr1, curr2));
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String N = sc.next();
        int curr1 = 0, curr2 = 0;
        for (int i = 0; i < N.length(); i++) {
            int c = N.charAt(i) - '0';
            curr1 += c == i % 2 ? 1 : 0;
            curr2 += c == i % 2 ? 0 : 1;
        }
        System.out.println(Math.min(curr1, curr2));
    } main {
        Scanner sc = new Scanner(System.in);
        String N = sc.next();
        int curr1 = 0, curr2 = 0;
        for (int i = 0; i < N.length(); i++) {
            int c = N.charAt(i) - '0';
            curr1 += c == i % 2 ? 1 : 0;
            curr2 += c == i % 2 ? 0 : 1;
        }
        System.out.println(Math.min(curr1, curr2));
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String N = sc.next(); N sc.next() sc.next sc int curr1 = 0 curr1 0 curr2 = 0; curr2 0 for (int i = 0; i < N.length(); i++) {
            int c = N.charAt(i) - '0';
            curr1 += c == i % 2 ? 1 : 0;
            curr2 += c == i % 2 ? 0 : 1;
        } int i = 0; int i = 0; i 0 i < N.length() i N.length() N.length N i++ i++ i {
            int c = N.charAt(i) - '0';
            curr1 += c == i % 2 ? 1 : 0;
            curr2 += c == i % 2 ? 0 : 1;
        } {
            int c = N.charAt(i) - '0';
            curr1 += c == i % 2 ? 1 : 0;
            curr2 += c == i % 2 ? 0 : 1;
        } int c = N.charAt(i) - '0'; c N.charAt(i) - '0' N.charAt(i) N.charAt N i '0' curr1 += c == i % 2 ? 1 : 0 curr1 c == i % 2 ? 1 : 0 c == i % 2 c i % 2 i 2 1 0 curr2 += c == i % 2 ? 0 : 1 curr2 c == i % 2 ? 0 : 1 c == i % 2 c i % 2 i 2 0 1 System.out.println(Math.min(curr1, curr2)) System.out.println System.out System System.out Math.min(curr1, curr2) Math.min Math curr1 curr2 String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String N = sc.next();
        int curr1 = 0, curr2 = 0;
        for (int i = 0; i < N.length(); i++) {
            int c = N.charAt(i) - '0';
            curr1 += c == i % 2 ? 1 : 0;
            curr2 += c == i % 2 ? 0 : 1;
        }
        System.out.println(Math.min(curr1, curr2));
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String N = sc.next();
        int curr1 = 0, curr2 = 0;
        for (int i = 0; i < N.length(); i++) {
            int c = N.charAt(i) - '0';
            curr1 += c == i % 2 ? 1 : 0;
            curr2 += c == i % 2 ? 0 : 1;
        }
        System.out.println(Math.min(curr1, curr2));
    }
} Main
import java.util.Scanner;

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