import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        String S = sc.next();

        int ans = solve(S);
        System.out.println(ans);

    }

    private static int solve(String s) {
        char[] sn = s.toCharArray();
        int white = count(sn, '0', '1');
        int black = count(sn, '1', '0');
        return Math.min(white, black);
    }

    private static int count(char[] sn, char match, char counterpart) {
        int cnt = 0;
        for (int i = 0; i < sn.length; i++) {
            if (i % 2 == 0 && sn[i] == counterpart) {
                cnt++;
            }
            if (i % 2 == 1 && sn[i] == match) {
                cnt++;
            }
        }
        return cnt;
    }
} 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 ans = solve(S);
        System.out.println(ans);

    }

    private static int solve(String s) {
        char[] sn = s.toCharArray();
        int white = count(sn, '0', '1');
        int black = count(sn, '1', '0');
        return Math.min(white, black);
    }

    private static int count(char[] sn, char match, char counterpart) {
        int cnt = 0;
        for (int i = 0; i < sn.length; i++) {
            if (i % 2 == 0 && sn[i] == counterpart) {
                cnt++;
            }
            if (i % 2 == 1 && sn[i] == match) {
                cnt++;
            }
        }
        return cnt;
    }
} Main public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        String S = sc.next();

        int ans = solve(S);
        System.out.println(ans);

    } main {

        Scanner sc = new Scanner(System.in);
        String S = sc.next();

        int ans = solve(S);
        System.out.println(ans);

    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.next(); S sc.next() sc.next sc int ans = solve(S); ans solve(S) solve S System.out.println(ans) System.out.println System.out System System.out ans String[] args args private static int solve(String s) {
        char[] sn = s.toCharArray();
        int white = count(sn, '0', '1');
        int black = count(sn, '1', '0');
        return Math.min(white, black);
    } solve {
        char[] sn = s.toCharArray();
        int white = count(sn, '0', '1');
        int black = count(sn, '1', '0');
        return Math.min(white, black);
    } char[] sn = s.toCharArray(); sn s.toCharArray() s.toCharArray s int white = count(sn, '0', '1'); white count(sn, '0', '1') count sn '0' '1' int black = count(sn, '1', '0'); black count(sn, '1', '0') count sn '1' '0' return Math.min(white, black); Math.min(white, black) Math.min Math white black String s s private static int count(char[] sn, char match, char counterpart) {
        int cnt = 0;
        for (int i = 0; i < sn.length; i++) {
            if (i % 2 == 0 && sn[i] == counterpart) {
                cnt++;
            }
            if (i % 2 == 1 && sn[i] == match) {
                cnt++;
            }
        }
        return cnt;
    } count {
        int cnt = 0;
        for (int i = 0; i < sn.length; i++) {
            if (i % 2 == 0 && sn[i] == counterpart) {
                cnt++;
            }
            if (i % 2 == 1 && sn[i] == match) {
                cnt++;
            }
        }
        return cnt;
    } int cnt = 0; cnt 0 for (int i = 0; i < sn.length; i++) {
            if (i % 2 == 0 && sn[i] == counterpart) {
                cnt++;
            }
            if (i % 2 == 1 && sn[i] == match) {
                cnt++;
            }
        } int i = 0; int i = 0; i 0 i < sn.length i sn.length sn sn.length i++ i++ i {
            if (i % 2 == 0 && sn[i] == counterpart) {
                cnt++;
            }
            if (i % 2 == 1 && sn[i] == match) {
                cnt++;
            }
        } {
            if (i % 2 == 0 && sn[i] == counterpart) {
                cnt++;
            }
            if (i % 2 == 1 && sn[i] == match) {
                cnt++;
            }
        } if (i % 2 == 0 && sn[i] == counterpart) {
                cnt++;
            } i % 2 == 0 && sn[i] == counterpart i % 2 == 0 i % 2 i 2 0 sn[i] == counterpart sn[i] sn i counterpart {
                cnt++;
            } cnt++ cnt if (i % 2 == 1 && sn[i] == match) {
                cnt++;
            } i % 2 == 1 && sn[i] == match i % 2 == 1 i % 2 i 2 1 sn[i] == match sn[i] sn i match {
                cnt++;
            } cnt++ cnt return cnt; cnt char[] sn sn char match match char counterpart counterpart public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        String S = sc.next();

        int ans = solve(S);
        System.out.println(ans);

    }

    private static int solve(String s) {
        char[] sn = s.toCharArray();
        int white = count(sn, '0', '1');
        int black = count(sn, '1', '0');
        return Math.min(white, black);
    }

    private static int count(char[] sn, char match, char counterpart) {
        int cnt = 0;
        for (int i = 0; i < sn.length; i++) {
            if (i % 2 == 0 && sn[i] == counterpart) {
                cnt++;
            }
            if (i % 2 == 1 && sn[i] == match) {
                cnt++;
            }
        }
        return cnt;
    }
} public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        String S = sc.next();

        int ans = solve(S);
        System.out.println(ans);

    }

    private static int solve(String s) {
        char[] sn = s.toCharArray();
        int white = count(sn, '0', '1');
        int black = count(sn, '1', '0');
        return Math.min(white, black);
    }

    private static int count(char[] sn, char match, char counterpart) {
        int cnt = 0;
        for (int i = 0; i < sn.length; i++) {
            if (i % 2 == 0 && sn[i] == counterpart) {
                cnt++;
            }
            if (i % 2 == 1 && sn[i] == match) {
                cnt++;
            }
        }
        return cnt;
    }
} 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 ans = solve(S);
        System.out.println(ans);

    }

    private static int solve(String s) {
        char[] sn = s.toCharArray();
        int white = count(sn, '0', '1');
        int black = count(sn, '1', '0');
        return Math.min(white, black);
    }

    private static int count(char[] sn, char match, char counterpart) {
        int cnt = 0;
        for (int i = 0; i < sn.length; i++) {
            if (i % 2 == 0 && sn[i] == counterpart) {
                cnt++;
            }
            if (i % 2 == 1 && sn[i] == match) {
                cnt++;
            }
        }
        return cnt;
    }
}
