import java.util.Scanner;

public class Main {
    public static void main(String[] args) {

        Scanner s = new Scanner(System.in);
        char[] chars = s.next().toCharArray();
        int[] n = new int[chars.length];

        for (int i = 0; i < chars.length; i++) {
            n[i] = Character.getNumericValue(chars[i]);
        }

        int wb = 0;
        int bw = 0;

        for (int i = 0; i < chars.length; i++) {
            if (i % 2 == 1 && n[i] == 0) {
                wb++;
            } else if (i % 2 == 0 && n[i] == 1) {
                wb++;
            } else if (i % 2 == 1 && n[i] == 1) {
                bw++;
            } else if (i % 2 == 0 && n[i] == 0) {
                bw++;
            }
        }
        System.out.println(wb < bw ? wb : bw);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {

        Scanner s = new Scanner(System.in);
        char[] chars = s.next().toCharArray();
        int[] n = new int[chars.length];

        for (int i = 0; i < chars.length; i++) {
            n[i] = Character.getNumericValue(chars[i]);
        }

        int wb = 0;
        int bw = 0;

        for (int i = 0; i < chars.length; i++) {
            if (i % 2 == 1 && n[i] == 0) {
                wb++;
            } else if (i % 2 == 0 && n[i] == 1) {
                wb++;
            } else if (i % 2 == 1 && n[i] == 1) {
                bw++;
            } else if (i % 2 == 0 && n[i] == 0) {
                bw++;
            }
        }
        System.out.println(wb < bw ? wb : bw);
    }
} Main public static void main(String[] args) {

        Scanner s = new Scanner(System.in);
        char[] chars = s.next().toCharArray();
        int[] n = new int[chars.length];

        for (int i = 0; i < chars.length; i++) {
            n[i] = Character.getNumericValue(chars[i]);
        }

        int wb = 0;
        int bw = 0;

        for (int i = 0; i < chars.length; i++) {
            if (i % 2 == 1 && n[i] == 0) {
                wb++;
            } else if (i % 2 == 0 && n[i] == 1) {
                wb++;
            } else if (i % 2 == 1 && n[i] == 1) {
                bw++;
            } else if (i % 2 == 0 && n[i] == 0) {
                bw++;
            }
        }
        System.out.println(wb < bw ? wb : bw);
    } main {

        Scanner s = new Scanner(System.in);
        char[] chars = s.next().toCharArray();
        int[] n = new int[chars.length];

        for (int i = 0; i < chars.length; i++) {
            n[i] = Character.getNumericValue(chars[i]);
        }

        int wb = 0;
        int bw = 0;

        for (int i = 0; i < chars.length; i++) {
            if (i % 2 == 1 && n[i] == 0) {
                wb++;
            } else if (i % 2 == 0 && n[i] == 1) {
                wb++;
            } else if (i % 2 == 1 && n[i] == 1) {
                bw++;
            } else if (i % 2 == 0 && n[i] == 0) {
                bw++;
            }
        }
        System.out.println(wb < bw ? wb : bw);
    } Scanner s = new Scanner(System.in); s new Scanner(System.in) char[] chars = s.next().toCharArray(); chars s.next().toCharArray() s.next().toCharArray s.next() s.next s int[] n = new int[chars.length]; n new int[chars.length] chars.length chars chars.length for (int i = 0; i < chars.length; i++) {
            n[i] = Character.getNumericValue(chars[i]);
        } int i = 0; int i = 0; i 0 i < chars.length i chars.length chars chars.length i++ i++ i {
            n[i] = Character.getNumericValue(chars[i]);
        } {
            n[i] = Character.getNumericValue(chars[i]);
        } n[i] = Character.getNumericValue(chars[i]) n[i] n i Character.getNumericValue(chars[i]) Character.getNumericValue Character chars[i] chars i int wb = 0; wb 0 int bw = 0; bw 0 for (int i = 0; i < chars.length; i++) {
            if (i % 2 == 1 && n[i] == 0) {
                wb++;
            } else if (i % 2 == 0 && n[i] == 1) {
                wb++;
            } else if (i % 2 == 1 && n[i] == 1) {
                bw++;
            } else if (i % 2 == 0 && n[i] == 0) {
                bw++;
            }
        } int i = 0; int i = 0; i 0 i < chars.length i chars.length chars chars.length i++ i++ i {
            if (i % 2 == 1 && n[i] == 0) {
                wb++;
            } else if (i % 2 == 0 && n[i] == 1) {
                wb++;
            } else if (i % 2 == 1 && n[i] == 1) {
                bw++;
            } else if (i % 2 == 0 && n[i] == 0) {
                bw++;
            }
        } {
            if (i % 2 == 1 && n[i] == 0) {
                wb++;
            } else if (i % 2 == 0 && n[i] == 1) {
                wb++;
            } else if (i % 2 == 1 && n[i] == 1) {
                bw++;
            } else if (i % 2 == 0 && n[i] == 0) {
                bw++;
            }
        } if (i % 2 == 1 && n[i] == 0) {
                wb++;
            } else if (i % 2 == 0 && n[i] == 1) {
                wb++;
            } else if (i % 2 == 1 && n[i] == 1) {
                bw++;
            } else if (i % 2 == 0 && n[i] == 0) {
                bw++;
            } i % 2 == 1 && n[i] == 0 i % 2 == 1 i % 2 i 2 1 n[i] == 0 n[i] n i 0 {
                wb++;
            } wb++ wb if (i % 2 == 0 && n[i] == 1) {
                wb++;
            } else if (i % 2 == 1 && n[i] == 1) {
                bw++;
            } else if (i % 2 == 0 && n[i] == 0) {
                bw++;
            } i % 2 == 0 && n[i] == 1 i % 2 == 0 i % 2 i 2 0 n[i] == 1 n[i] n i 1 {
                wb++;
            } wb++ wb if (i % 2 == 1 && n[i] == 1) {
                bw++;
            } else if (i % 2 == 0 && n[i] == 0) {
                bw++;
            } i % 2 == 1 && n[i] == 1 i % 2 == 1 i % 2 i 2 1 n[i] == 1 n[i] n i 1 {
                bw++;
            } bw++ bw if (i % 2 == 0 && n[i] == 0) {
                bw++;
            } i % 2 == 0 && n[i] == 0 i % 2 == 0 i % 2 i 2 0 n[i] == 0 n[i] n i 0 {
                bw++;
            } bw++ bw System.out.println(wb < bw ? wb : bw) System.out.println System.out System System.out wb < bw ? wb : bw wb < bw wb bw wb bw String[] args args public class Main {
    public static void main(String[] args) {

        Scanner s = new Scanner(System.in);
        char[] chars = s.next().toCharArray();
        int[] n = new int[chars.length];

        for (int i = 0; i < chars.length; i++) {
            n[i] = Character.getNumericValue(chars[i]);
        }

        int wb = 0;
        int bw = 0;

        for (int i = 0; i < chars.length; i++) {
            if (i % 2 == 1 && n[i] == 0) {
                wb++;
            } else if (i % 2 == 0 && n[i] == 1) {
                wb++;
            } else if (i % 2 == 1 && n[i] == 1) {
                bw++;
            } else if (i % 2 == 0 && n[i] == 0) {
                bw++;
            }
        }
        System.out.println(wb < bw ? wb : bw);
    }
} public class Main {
    public static void main(String[] args) {

        Scanner s = new Scanner(System.in);
        char[] chars = s.next().toCharArray();
        int[] n = new int[chars.length];

        for (int i = 0; i < chars.length; i++) {
            n[i] = Character.getNumericValue(chars[i]);
        }

        int wb = 0;
        int bw = 0;

        for (int i = 0; i < chars.length; i++) {
            if (i % 2 == 1 && n[i] == 0) {
                wb++;
            } else if (i % 2 == 0 && n[i] == 1) {
                wb++;
            } else if (i % 2 == 1 && n[i] == 1) {
                bw++;
            } else if (i % 2 == 0 && n[i] == 0) {
                bw++;
            }
        }
        System.out.println(wb < bw ? wb : bw);
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {

        Scanner s = new Scanner(System.in);
        char[] chars = s.next().toCharArray();
        int[] n = new int[chars.length];

        for (int i = 0; i < chars.length; i++) {
            n[i] = Character.getNumericValue(chars[i]);
        }

        int wb = 0;
        int bw = 0;

        for (int i = 0; i < chars.length; i++) {
            if (i % 2 == 1 && n[i] == 0) {
                wb++;
            } else if (i % 2 == 0 && n[i] == 1) {
                wb++;
            } else if (i % 2 == 1 && n[i] == 1) {
                bw++;
            } else if (i % 2 == 0 && n[i] == 0) {
                bw++;
            }
        }
        System.out.println(wb < bw ? wb : bw);
    }
}