import java.util.Scanner;

public class Main {

    int solve(String s, boolean flip) {
        int n = s.length();
        int[] as = new int[n];
        for (int i = 0; i < n; i++) {
            as[i] = s.charAt(i) == '0' ? 0 : 1;
        }
        if (flip) {
            as[0] = as[0] == 0 ? 1 : 0;
        }
        int ans = flip ? 1 : 0;
        for (int i = 1; i < n; i++) {
            if (as[i] == as[i - 1]) {
                as[i] = as[i] == 0 ? 1 : 0;
                ans++;
            }
        }
        return ans;
    }


    void run() {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        System.out.println(Math.min(solve(s, false), solve(s, true)));
    }

    public static void main(String[] args) {
        new Main().run();
    }
} import java.util.Scanner; Scanner java.util public class Main {

    int solve(String s, boolean flip) {
        int n = s.length();
        int[] as = new int[n];
        for (int i = 0; i < n; i++) {
            as[i] = s.charAt(i) == '0' ? 0 : 1;
        }
        if (flip) {
            as[0] = as[0] == 0 ? 1 : 0;
        }
        int ans = flip ? 1 : 0;
        for (int i = 1; i < n; i++) {
            if (as[i] == as[i - 1]) {
                as[i] = as[i] == 0 ? 1 : 0;
                ans++;
            }
        }
        return ans;
    }


    void run() {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        System.out.println(Math.min(solve(s, false), solve(s, true)));
    }

    public static void main(String[] args) {
        new Main().run();
    }
} Main int solve(String s, boolean flip) {
        int n = s.length();
        int[] as = new int[n];
        for (int i = 0; i < n; i++) {
            as[i] = s.charAt(i) == '0' ? 0 : 1;
        }
        if (flip) {
            as[0] = as[0] == 0 ? 1 : 0;
        }
        int ans = flip ? 1 : 0;
        for (int i = 1; i < n; i++) {
            if (as[i] == as[i - 1]) {
                as[i] = as[i] == 0 ? 1 : 0;
                ans++;
            }
        }
        return ans;
    } solve {
        int n = s.length();
        int[] as = new int[n];
        for (int i = 0; i < n; i++) {
            as[i] = s.charAt(i) == '0' ? 0 : 1;
        }
        if (flip) {
            as[0] = as[0] == 0 ? 1 : 0;
        }
        int ans = flip ? 1 : 0;
        for (int i = 1; i < n; i++) {
            if (as[i] == as[i - 1]) {
                as[i] = as[i] == 0 ? 1 : 0;
                ans++;
            }
        }
        return ans;
    } int n = s.length(); n s.length() s.length s int[] as = new int[n]; as new int[n] n for (int i = 0; i < n; i++) {
            as[i] = s.charAt(i) == '0' ? 0 : 1;
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            as[i] = s.charAt(i) == '0' ? 0 : 1;
        } {
            as[i] = s.charAt(i) == '0' ? 0 : 1;
        } as[i] = s.charAt(i) == '0' ? 0 : 1 as[i] as i s.charAt(i) == '0' ? 0 : 1 s.charAt(i) == '0' s.charAt(i) s.charAt s i '0' 0 1 if (flip) {
            as[0] = as[0] == 0 ? 1 : 0;
        } flip {
            as[0] = as[0] == 0 ? 1 : 0;
        } as[0] = as[0] == 0 ? 1 : 0 as[0] as 0 as[0] == 0 ? 1 : 0 as[0] == 0 as[0] as 0 0 1 0 int ans = flip ? 1 : 0; ans flip ? 1 : 0 flip 1 0 for (int i = 1; i < n; i++) {
            if (as[i] == as[i - 1]) {
                as[i] = as[i] == 0 ? 1 : 0;
                ans++;
            }
        } int i = 1; int i = 1; i 1 i < n i n i++ i++ i {
            if (as[i] == as[i - 1]) {
                as[i] = as[i] == 0 ? 1 : 0;
                ans++;
            }
        } {
            if (as[i] == as[i - 1]) {
                as[i] = as[i] == 0 ? 1 : 0;
                ans++;
            }
        } if (as[i] == as[i - 1]) {
                as[i] = as[i] == 0 ? 1 : 0;
                ans++;
            } as[i] == as[i - 1] as[i] as i as[i - 1] as i - 1 i 1 {
                as[i] = as[i] == 0 ? 1 : 0;
                ans++;
            } as[i] = as[i] == 0 ? 1 : 0 as[i] as i as[i] == 0 ? 1 : 0 as[i] == 0 as[i] as i 0 1 0 ans++ ans return ans; ans String s s boolean flip flip void run() {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        System.out.println(Math.min(solve(s, false), solve(s, true)));
    } run {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        System.out.println(Math.min(solve(s, false), solve(s, true)));
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc System.out.println(Math.min(solve(s, false), solve(s, true))) System.out.println System.out System System.out Math.min(solve(s, false), solve(s, true)) Math.min Math solve(s, false) solve s false solve(s, true) solve s true public static void main(String[] args) {
        new Main().run();
    } main {
        new Main().run();
    } new Main().run() new Main().run new Main() String[] args args public class Main {

    int solve(String s, boolean flip) {
        int n = s.length();
        int[] as = new int[n];
        for (int i = 0; i < n; i++) {
            as[i] = s.charAt(i) == '0' ? 0 : 1;
        }
        if (flip) {
            as[0] = as[0] == 0 ? 1 : 0;
        }
        int ans = flip ? 1 : 0;
        for (int i = 1; i < n; i++) {
            if (as[i] == as[i - 1]) {
                as[i] = as[i] == 0 ? 1 : 0;
                ans++;
            }
        }
        return ans;
    }


    void run() {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        System.out.println(Math.min(solve(s, false), solve(s, true)));
    }

    public static void main(String[] args) {
        new Main().run();
    }
} public class Main {

    int solve(String s, boolean flip) {
        int n = s.length();
        int[] as = new int[n];
        for (int i = 0; i < n; i++) {
            as[i] = s.charAt(i) == '0' ? 0 : 1;
        }
        if (flip) {
            as[0] = as[0] == 0 ? 1 : 0;
        }
        int ans = flip ? 1 : 0;
        for (int i = 1; i < n; i++) {
            if (as[i] == as[i - 1]) {
                as[i] = as[i] == 0 ? 1 : 0;
                ans++;
            }
        }
        return ans;
    }


    void run() {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        System.out.println(Math.min(solve(s, false), solve(s, true)));
    }

    public static void main(String[] args) {
        new Main().run();
    }
} Main
import java.util.Scanner;

public class Main {

    int solve(String s, boolean flip) {
        int n = s.length();
        int[] as = new int[n];
        for (int i = 0; i < n; i++) {
            as[i] = s.charAt(i) == '0' ? 0 : 1;
        }
        if (flip) {
            as[0] = as[0] == 0 ? 1 : 0;
        }
        int ans = flip ? 1 : 0;
        for (int i = 1; i < n; i++) {
            if (as[i] == as[i - 1]) {
                as[i] = as[i] == 0 ? 1 : 0;
                ans++;
            }
        }
        return ans;
    }


    void run() {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        System.out.println(Math.min(solve(s, false), solve(s, true)));
    }

    public static void main(String[] args) {
        new Main().run();
    }
}
