
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        // write your code here
        Scanner scanner = new Scanner(System.in);
        String S = scanner.next();
        int p1 = 0, p2 = 0;
        if (S.length() == 1) {
            System.out.println(0);
            return;
        }

        if (S.charAt(0) == '0') p1 ++;
        if (S.charAt(0) == '1') p2 ++;
        for (int i = 1; i < S.length(); i ++) {
            if (i % 2 == 1) {
                if (S.charAt(i) == '1') {
                    p1 ++;
                } else {
                    p2 ++;
                }
            } else {
                if (S.charAt(i) == '0') {
                    p1 ++;
                } else {
                    p2 ++;
                }
            }
        }

        System.out.println(Math.min(p1, p2));
    }
} import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        // write your code here
        Scanner scanner = new Scanner(System.in);
        String S = scanner.next();
        int p1 = 0, p2 = 0;
        if (S.length() == 1) {
            System.out.println(0);
            return;
        }

        if (S.charAt(0) == '0') p1 ++;
        if (S.charAt(0) == '1') p2 ++;
        for (int i = 1; i < S.length(); i ++) {
            if (i % 2 == 1) {
                if (S.charAt(i) == '1') {
                    p1 ++;
                } else {
                    p2 ++;
                }
            } else {
                if (S.charAt(i) == '0') {
                    p1 ++;
                } else {
                    p2 ++;
                }
            }
        }

        System.out.println(Math.min(p1, p2));
    }
} Main public static void main(String[] args) {
        // write your code here
        Scanner scanner = new Scanner(System.in);
        String S = scanner.next();
        int p1 = 0, p2 = 0;
        if (S.length() == 1) {
            System.out.println(0);
            return;
        }

        if (S.charAt(0) == '0') p1 ++;
        if (S.charAt(0) == '1') p2 ++;
        for (int i = 1; i < S.length(); i ++) {
            if (i % 2 == 1) {
                if (S.charAt(i) == '1') {
                    p1 ++;
                } else {
                    p2 ++;
                }
            } else {
                if (S.charAt(i) == '0') {
                    p1 ++;
                } else {
                    p2 ++;
                }
            }
        }

        System.out.println(Math.min(p1, p2));
    } main {
        // write your code here
        Scanner scanner = new Scanner(System.in);
        String S = scanner.next();
        int p1 = 0, p2 = 0;
        if (S.length() == 1) {
            System.out.println(0);
            return;
        }

        if (S.charAt(0) == '0') p1 ++;
        if (S.charAt(0) == '1') p2 ++;
        for (int i = 1; i < S.length(); i ++) {
            if (i % 2 == 1) {
                if (S.charAt(i) == '1') {
                    p1 ++;
                } else {
                    p2 ++;
                }
            } else {
                if (S.charAt(i) == '0') {
                    p1 ++;
                } else {
                    p2 ++;
                }
            }
        }

        System.out.println(Math.min(p1, p2));
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) String S = scanner.next(); S scanner.next() scanner.next scanner int p1 = 0 p1 0 p2 = 0; p2 0 if (S.length() == 1) {
            System.out.println(0);
            return;
        } S.length() == 1 S.length() S.length S 1 {
            System.out.println(0);
            return;
        } System.out.println(0) System.out.println System.out System System.out 0 return; if (S.charAt(0) == '0') p1 ++; S.charAt(0) == '0' S.charAt(0) S.charAt S 0 '0' p1 ++ p1 if (S.charAt(0) == '1') p2 ++; S.charAt(0) == '1' S.charAt(0) S.charAt S 0 '1' p2 ++ p2 for (int i = 1; i < S.length(); i ++) {
            if (i % 2 == 1) {
                if (S.charAt(i) == '1') {
                    p1 ++;
                } else {
                    p2 ++;
                }
            } else {
                if (S.charAt(i) == '0') {
                    p1 ++;
                } else {
                    p2 ++;
                }
            }
        } int i = 1; int i = 1; i 1 i < S.length() i S.length() S.length S i ++ i ++ i {
            if (i % 2 == 1) {
                if (S.charAt(i) == '1') {
                    p1 ++;
                } else {
                    p2 ++;
                }
            } else {
                if (S.charAt(i) == '0') {
                    p1 ++;
                } else {
                    p2 ++;
                }
            }
        } {
            if (i % 2 == 1) {
                if (S.charAt(i) == '1') {
                    p1 ++;
                } else {
                    p2 ++;
                }
            } else {
                if (S.charAt(i) == '0') {
                    p1 ++;
                } else {
                    p2 ++;
                }
            }
        } if (i % 2 == 1) {
                if (S.charAt(i) == '1') {
                    p1 ++;
                } else {
                    p2 ++;
                }
            } else {
                if (S.charAt(i) == '0') {
                    p1 ++;
                } else {
                    p2 ++;
                }
            } i % 2 == 1 i % 2 i 2 1 {
                if (S.charAt(i) == '1') {
                    p1 ++;
                } else {
                    p2 ++;
                }
            } if (S.charAt(i) == '1') {
                    p1 ++;
                } else {
                    p2 ++;
                } S.charAt(i) == '1' S.charAt(i) S.charAt S i '1' {
                    p1 ++;
                } p1 ++ p1 {
                    p2 ++;
                } p2 ++ p2 {
                if (S.charAt(i) == '0') {
                    p1 ++;
                } else {
                    p2 ++;
                }
            } if (S.charAt(i) == '0') {
                    p1 ++;
                } else {
                    p2 ++;
                } S.charAt(i) == '0' S.charAt(i) S.charAt S i '0' {
                    p1 ++;
                } p1 ++ p1 {
                    p2 ++;
                } p2 ++ p2 System.out.println(Math.min(p1, p2)) System.out.println System.out System System.out Math.min(p1, p2) Math.min Math p1 p2 String[] args args public class Main {

    public static void main(String[] args) {
        // write your code here
        Scanner scanner = new Scanner(System.in);
        String S = scanner.next();
        int p1 = 0, p2 = 0;
        if (S.length() == 1) {
            System.out.println(0);
            return;
        }

        if (S.charAt(0) == '0') p1 ++;
        if (S.charAt(0) == '1') p2 ++;
        for (int i = 1; i < S.length(); i ++) {
            if (i % 2 == 1) {
                if (S.charAt(i) == '1') {
                    p1 ++;
                } else {
                    p2 ++;
                }
            } else {
                if (S.charAt(i) == '0') {
                    p1 ++;
                } else {
                    p2 ++;
                }
            }
        }

        System.out.println(Math.min(p1, p2));
    }
} public class Main {

    public static void main(String[] args) {
        // write your code here
        Scanner scanner = new Scanner(System.in);
        String S = scanner.next();
        int p1 = 0, p2 = 0;
        if (S.length() == 1) {
            System.out.println(0);
            return;
        }

        if (S.charAt(0) == '0') p1 ++;
        if (S.charAt(0) == '1') p2 ++;
        for (int i = 1; i < S.length(); i ++) {
            if (i % 2 == 1) {
                if (S.charAt(i) == '1') {
                    p1 ++;
                } else {
                    p2 ++;
                }
            } else {
                if (S.charAt(i) == '0') {
                    p1 ++;
                } else {
                    p2 ++;
                }
            }
        }

        System.out.println(Math.min(p1, p2));
    }
} Main

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        // write your code here
        Scanner scanner = new Scanner(System.in);
        String S = scanner.next();
        int p1 = 0, p2 = 0;
        if (S.length() == 1) {
            System.out.println(0);
            return;
        }

        if (S.charAt(0) == '0') p1 ++;
        if (S.charAt(0) == '1') p2 ++;
        for (int i = 1; i < S.length(); i ++) {
            if (i % 2 == 1) {
                if (S.charAt(i) == '1') {
                    p1 ++;
                } else {
                    p2 ++;
                }
            } else {
                if (S.charAt(i) == '0') {
                    p1 ++;
                } else {
                    p2 ++;
                }
            }
        }

        System.out.println(Math.min(p1, p2));
    }
}
