import java.util.*;

public class Main {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int n = s.length();
        boolean is0 = true;
        int count = 0;
        for (char c : s.toCharArray()) {
            if (is0 && c == '0') count++;
            if (!is0 && c != '0') count++;
            is0 = !is0;
        }
        System.out.println(Math.min(count, n - count));
    }
} import java.util.*; util.* java public class Main {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int n = s.length();
        boolean is0 = true;
        int count = 0;
        for (char c : s.toCharArray()) {
            if (is0 && c == '0') count++;
            if (!is0 && c != '0') count++;
            is0 = !is0;
        }
        System.out.println(Math.min(count, n - count));
    }
} Main public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int n = s.length();
        boolean is0 = true;
        int count = 0;
        for (char c : s.toCharArray()) {
            if (is0 && c == '0') count++;
            if (!is0 && c != '0') count++;
            is0 = !is0;
        }
        System.out.println(Math.min(count, n - count));
    } main {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int n = s.length();
        boolean is0 = true;
        int count = 0;
        for (char c : s.toCharArray()) {
            if (is0 && c == '0') count++;
            if (!is0 && c != '0') count++;
            is0 = !is0;
        }
        System.out.println(Math.min(count, n - count));
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc int n = s.length(); n s.length() s.length s boolean is0 = true; is0 true int count = 0; count 0 for (char c : s.toCharArray()) {
            if (is0 && c == '0') count++;
            if (!is0 && c != '0') count++;
            is0 = !is0;
        } char c s.toCharArray() s.toCharArray s {
            if (is0 && c == '0') count++;
            if (!is0 && c != '0') count++;
            is0 = !is0;
        } {
            if (is0 && c == '0') count++;
            if (!is0 && c != '0') count++;
            is0 = !is0;
        } if (is0 && c == '0') count++; is0 && c == '0' is0 c == '0' c '0' count++ count if (!is0 && c != '0') count++; !is0 && c != '0' !is0 is0 c != '0' c '0' count++ count is0 = !is0 is0 !is0 is0 System.out.println(Math.min(count, n - count)) System.out.println System.out System System.out Math.min(count, n - count) Math.min Math count n - count n count String args[] args public class Main {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int n = s.length();
        boolean is0 = true;
        int count = 0;
        for (char c : s.toCharArray()) {
            if (is0 && c == '0') count++;
            if (!is0 && c != '0') count++;
            is0 = !is0;
        }
        System.out.println(Math.min(count, n - count));
    }
} public class Main {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int n = s.length();
        boolean is0 = true;
        int count = 0;
        for (char c : s.toCharArray()) {
            if (is0 && c == '0') count++;
            if (!is0 && c != '0') count++;
            is0 = !is0;
        }
        System.out.println(Math.min(count, n - count));
    }
} Main
import java.util.*;

public class Main {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int n = s.length();
        boolean is0 = true;
        int count = 0;
        for (char c : s.toCharArray()) {
            if (is0 && c == '0') count++;
            if (!is0 && c != '0') count++;
            is0 = !is0;
        }
        System.out.println(Math.min(count, n - count));
    }
}