import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int num = (s.length() / 2) + s.length() % 2;
        String s1 = repeat("10", num).substring(0, s.length());
        String s2 = repeat("01", num).substring(0, s.length());

        int diff1 = 0;
        int diff2 = 0;
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) != s1.charAt(i)) diff1++;
            if (s.charAt(i) != s2.charAt(i)) diff2++;
        }

        System.out.println(diff1 > diff2 ? diff2 : diff1);
    }

    private static String repeat(String s, int i) {
        StringBuilder sb = new StringBuilder();
        for (int j = 0; j < i; j++) {
            sb.append(s);
        }
        return sb.toString();
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int num = (s.length() / 2) + s.length() % 2;
        String s1 = repeat("10", num).substring(0, s.length());
        String s2 = repeat("01", num).substring(0, s.length());

        int diff1 = 0;
        int diff2 = 0;
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) != s1.charAt(i)) diff1++;
            if (s.charAt(i) != s2.charAt(i)) diff2++;
        }

        System.out.println(diff1 > diff2 ? diff2 : diff1);
    }

    private static String repeat(String s, int i) {
        StringBuilder sb = new StringBuilder();
        for (int j = 0; j < i; j++) {
            sb.append(s);
        }
        return sb.toString();
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int num = (s.length() / 2) + s.length() % 2;
        String s1 = repeat("10", num).substring(0, s.length());
        String s2 = repeat("01", num).substring(0, s.length());

        int diff1 = 0;
        int diff2 = 0;
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) != s1.charAt(i)) diff1++;
            if (s.charAt(i) != s2.charAt(i)) diff2++;
        }

        System.out.println(diff1 > diff2 ? diff2 : diff1);
    } main {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int num = (s.length() / 2) + s.length() % 2;
        String s1 = repeat("10", num).substring(0, s.length());
        String s2 = repeat("01", num).substring(0, s.length());

        int diff1 = 0;
        int diff2 = 0;
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) != s1.charAt(i)) diff1++;
            if (s.charAt(i) != s2.charAt(i)) diff2++;
        }

        System.out.println(diff1 > diff2 ? diff2 : diff1);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc int num = (s.length() / 2) + s.length() % 2; num (s.length() / 2) + s.length() % 2 (s.length() / 2) s.length() s.length s 2 s.length() % 2 s.length() s.length s 2 String s1 = repeat("10", num).substring(0, s.length()); s1 repeat("10", num).substring(0, s.length()) repeat("10", num).substring repeat("10", num) repeat "10" num 0 s.length() s.length s String s2 = repeat("01", num).substring(0, s.length()); s2 repeat("01", num).substring(0, s.length()) repeat("01", num).substring repeat("01", num) repeat "01" num 0 s.length() s.length s int diff1 = 0; diff1 0 int diff2 = 0; diff2 0 for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) != s1.charAt(i)) diff1++;
            if (s.charAt(i) != s2.charAt(i)) diff2++;
        } int i = 0; int i = 0; i 0 i < s.length() i s.length() s.length s i++ i++ i {
            if (s.charAt(i) != s1.charAt(i)) diff1++;
            if (s.charAt(i) != s2.charAt(i)) diff2++;
        } {
            if (s.charAt(i) != s1.charAt(i)) diff1++;
            if (s.charAt(i) != s2.charAt(i)) diff2++;
        } if (s.charAt(i) != s1.charAt(i)) diff1++; s.charAt(i) != s1.charAt(i) s.charAt(i) s.charAt s i s1.charAt(i) s1.charAt s1 i diff1++ diff1 if (s.charAt(i) != s2.charAt(i)) diff2++; s.charAt(i) != s2.charAt(i) s.charAt(i) s.charAt s i s2.charAt(i) s2.charAt s2 i diff2++ diff2 System.out.println(diff1 > diff2 ? diff2 : diff1) System.out.println System.out System System.out diff1 > diff2 ? diff2 : diff1 diff1 > diff2 diff1 diff2 diff2 diff1 String[] args args private static String repeat(String s, int i) {
        StringBuilder sb = new StringBuilder();
        for (int j = 0; j < i; j++) {
            sb.append(s);
        }
        return sb.toString();
    } repeat {
        StringBuilder sb = new StringBuilder();
        for (int j = 0; j < i; j++) {
            sb.append(s);
        }
        return sb.toString();
    } StringBuilder sb = new StringBuilder(); sb new StringBuilder() for (int j = 0; j < i; j++) {
            sb.append(s);
        } int j = 0; int j = 0; j 0 j < i j i j++ j++ j {
            sb.append(s);
        } {
            sb.append(s);
        } sb.append(s) sb.append sb s return sb.toString(); sb.toString() sb.toString sb String s s int i i public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int num = (s.length() / 2) + s.length() % 2;
        String s1 = repeat("10", num).substring(0, s.length());
        String s2 = repeat("01", num).substring(0, s.length());

        int diff1 = 0;
        int diff2 = 0;
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) != s1.charAt(i)) diff1++;
            if (s.charAt(i) != s2.charAt(i)) diff2++;
        }

        System.out.println(diff1 > diff2 ? diff2 : diff1);
    }

    private static String repeat(String s, int i) {
        StringBuilder sb = new StringBuilder();
        for (int j = 0; j < i; j++) {
            sb.append(s);
        }
        return sb.toString();
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int num = (s.length() / 2) + s.length() % 2;
        String s1 = repeat("10", num).substring(0, s.length());
        String s2 = repeat("01", num).substring(0, s.length());

        int diff1 = 0;
        int diff2 = 0;
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) != s1.charAt(i)) diff1++;
            if (s.charAt(i) != s2.charAt(i)) diff2++;
        }

        System.out.println(diff1 > diff2 ? diff2 : diff1);
    }

    private static String repeat(String s, int i) {
        StringBuilder sb = new StringBuilder();
        for (int j = 0; j < i; j++) {
            sb.append(s);
        }
        return sb.toString();
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int num = (s.length() / 2) + s.length() % 2;
        String s1 = repeat("10", num).substring(0, s.length());
        String s2 = repeat("01", num).substring(0, s.length());

        int diff1 = 0;
        int diff2 = 0;
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) != s1.charAt(i)) diff1++;
            if (s.charAt(i) != s2.charAt(i)) diff2++;
        }

        System.out.println(diff1 > diff2 ? diff2 : diff1);
    }

    private static String repeat(String s, int i) {
        StringBuilder sb = new StringBuilder();
        for (int j = 0; j < i; j++) {
            sb.append(s);
        }
        return sb.toString();
    }
}
