import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastScanner in = new FastScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        C solver = new C();
        solver.solve(1, in, out);
        out.close();
    }

    static class C {
        public void solve(int testNumber, FastScanner in, PrintWriter out) {
            String s = in.ns();
            int n = s.length();
            int[] res = new int[2];
            for (int first = 0; first <= 1; first++) {
                int cur = first;
                for (int i = 0; i < n; i++) {
                    if (s.charAt(i) - '0' != cur)
                        res[first]++;
                    cur = 1 - cur;
                }
            }
            out.println(Math.min(res[0], res[1]));
        }

    }

    static class FastScanner {
        private BufferedReader in;
        private StringTokenizer st;

        public FastScanner(InputStream stream) {
            in = new BufferedReader(new InputStreamReader(stream));
        }

        public String ns() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    String rl = in.readLine();
                    if (rl == null) {
                        return null;
                    }
                    st = new StringTokenizer(rl);
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return st.nextToken();
        }

    }
}
 import java.io.OutputStream; OutputStream java.io import java.io.IOException; IOException java.io import java.io.InputStream; InputStream java.io import java.io.PrintWriter; PrintWriter java.io import java.util.StringTokenizer; StringTokenizer java.util import java.io.IOException; IOException java.io import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.InputStream; InputStream java.io public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastScanner in = new FastScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        C solver = new C();
        solver.solve(1, in, out);
        out.close();
    }

    static class C {
        public void solve(int testNumber, FastScanner in, PrintWriter out) {
            String s = in.ns();
            int n = s.length();
            int[] res = new int[2];
            for (int first = 0; first <= 1; first++) {
                int cur = first;
                for (int i = 0; i < n; i++) {
                    if (s.charAt(i) - '0' != cur)
                        res[first]++;
                    cur = 1 - cur;
                }
            }
            out.println(Math.min(res[0], res[1]));
        }

    }

    static class FastScanner {
        private BufferedReader in;
        private StringTokenizer st;

        public FastScanner(InputStream stream) {
            in = new BufferedReader(new InputStreamReader(stream));
        }

        public String ns() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    String rl = in.readLine();
                    if (rl == null) {
                        return null;
                    }
                    st = new StringTokenizer(rl);
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return st.nextToken();
        }

    }
} Main public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastScanner in = new FastScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        C solver = new C();
        solver.solve(1, in, out);
        out.close();
    } main {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastScanner in = new FastScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        C solver = new C();
        solver.solve(1, in, out);
        out.close();
    } InputStream inputStream = System.in; inputStream System.in System System.in OutputStream outputStream = System.out; outputStream System.out System System.out FastScanner in = new FastScanner(inputStream); in new FastScanner(inputStream) PrintWriter out = new PrintWriter(outputStream); out new PrintWriter(outputStream) C solver = new C(); solver new C() solver.solve(1, in, out) solver.solve solver 1 in out out.close() out.close out String[] args args static class C {
        public void solve(int testNumber, FastScanner in, PrintWriter out) {
            String s = in.ns();
            int n = s.length();
            int[] res = new int[2];
            for (int first = 0; first <= 1; first++) {
                int cur = first;
                for (int i = 0; i < n; i++) {
                    if (s.charAt(i) - '0' != cur)
                        res[first]++;
                    cur = 1 - cur;
                }
            }
            out.println(Math.min(res[0], res[1]));
        }

    } C public void solve(int testNumber, FastScanner in, PrintWriter out) {
            String s = in.ns();
            int n = s.length();
            int[] res = new int[2];
            for (int first = 0; first <= 1; first++) {
                int cur = first;
                for (int i = 0; i < n; i++) {
                    if (s.charAt(i) - '0' != cur)
                        res[first]++;
                    cur = 1 - cur;
                }
            }
            out.println(Math.min(res[0], res[1]));
        } solve {
            String s = in.ns();
            int n = s.length();
            int[] res = new int[2];
            for (int first = 0; first <= 1; first++) {
                int cur = first;
                for (int i = 0; i < n; i++) {
                    if (s.charAt(i) - '0' != cur)
                        res[first]++;
                    cur = 1 - cur;
                }
            }
            out.println(Math.min(res[0], res[1]));
        } String s = in.ns(); s in.ns() in.ns in int n = s.length(); n s.length() s.length s int[] res = new int[2]; res new int[2] 2 for (int first = 0; first <= 1; first++) {
                int cur = first;
                for (int i = 0; i < n; i++) {
                    if (s.charAt(i) - '0' != cur)
                        res[first]++;
                    cur = 1 - cur;
                }
            } int first = 0; int first = 0; first 0 first <= 1 first 1 first++ first++ first {
                int cur = first;
                for (int i = 0; i < n; i++) {
                    if (s.charAt(i) - '0' != cur)
                        res[first]++;
                    cur = 1 - cur;
                }
            } {
                int cur = first;
                for (int i = 0; i < n; i++) {
                    if (s.charAt(i) - '0' != cur)
                        res[first]++;
                    cur = 1 - cur;
                }
            } int cur = first; cur first for (int i = 0; i < n; i++) {
                    if (s.charAt(i) - '0' != cur)
                        res[first]++;
                    cur = 1 - cur;
                } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
                    if (s.charAt(i) - '0' != cur)
                        res[first]++;
                    cur = 1 - cur;
                } {
                    if (s.charAt(i) - '0' != cur)
                        res[first]++;
                    cur = 1 - cur;
                } if (s.charAt(i) - '0' != cur)
                        res[first]++; s.charAt(i) - '0' != cur s.charAt(i) - '0' s.charAt(i) s.charAt s i '0' cur res[first]++ res[first] res first cur = 1 - cur cur 1 - cur 1 cur out.println(Math.min(res[0], res[1])) out.println out Math.min(res[0], res[1]) Math.min Math res[0] res 0 res[1] res 1 int testNumber testNumber FastScanner in in PrintWriter out out static class FastScanner {
        private BufferedReader in;
        private StringTokenizer st;

        public FastScanner(InputStream stream) {
            in = new BufferedReader(new InputStreamReader(stream));
        }

        public String ns() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    String rl = in.readLine();
                    if (rl == null) {
                        return null;
                    }
                    st = new StringTokenizer(rl);
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return st.nextToken();
        }

    } FastScanner private BufferedReader in; in private StringTokenizer st; st public FastScanner(InputStream stream) {
            in = new BufferedReader(new InputStreamReader(stream));
        } FastScanner {
            in = new BufferedReader(new InputStreamReader(stream));
        } in = new BufferedReader(new InputStreamReader(stream)) in new BufferedReader(new InputStreamReader(stream)) InputStream stream stream public String ns() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    String rl = in.readLine();
                    if (rl == null) {
                        return null;
                    }
                    st = new StringTokenizer(rl);
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return st.nextToken();
        } ns {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    String rl = in.readLine();
                    if (rl == null) {
                        return null;
                    }
                    st = new StringTokenizer(rl);
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return st.nextToken();
        } while (st == null || !st.hasMoreTokens()) {
                try {
                    String rl = in.readLine();
                    if (rl == null) {
                        return null;
                    }
                    st = new StringTokenizer(rl);
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            } st == null || !st.hasMoreTokens() st == null st null !st.hasMoreTokens() st.hasMoreTokens() st.hasMoreTokens st {
                try {
                    String rl = in.readLine();
                    if (rl == null) {
                        return null;
                    }
                    st = new StringTokenizer(rl);
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            } try {
                    String rl = in.readLine();
                    if (rl == null) {
                        return null;
                    }
                    st = new StringTokenizer(rl);
                } catch (IOException e) {
                    throw new RuntimeException(e);
                } catch (IOException e) {
                    throw new RuntimeException(e);
                } IOException e {
                    throw new RuntimeException(e);
                } throw new RuntimeException(e); new RuntimeException(e) {
                    String rl = in.readLine();
                    if (rl == null) {
                        return null;
                    }
                    st = new StringTokenizer(rl);
                } String rl = in.readLine(); rl in.readLine() in.readLine in if (rl == null) {
                        return null;
                    } rl == null rl null {
                        return null;
                    } return null; null st = new StringTokenizer(rl) st new StringTokenizer(rl) return st.nextToken(); st.nextToken() st.nextToken st public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastScanner in = new FastScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        C solver = new C();
        solver.solve(1, in, out);
        out.close();
    }

    static class C {
        public void solve(int testNumber, FastScanner in, PrintWriter out) {
            String s = in.ns();
            int n = s.length();
            int[] res = new int[2];
            for (int first = 0; first <= 1; first++) {
                int cur = first;
                for (int i = 0; i < n; i++) {
                    if (s.charAt(i) - '0' != cur)
                        res[first]++;
                    cur = 1 - cur;
                }
            }
            out.println(Math.min(res[0], res[1]));
        }

    }

    static class FastScanner {
        private BufferedReader in;
        private StringTokenizer st;

        public FastScanner(InputStream stream) {
            in = new BufferedReader(new InputStreamReader(stream));
        }

        public String ns() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    String rl = in.readLine();
                    if (rl == null) {
                        return null;
                    }
                    st = new StringTokenizer(rl);
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return st.nextToken();
        }

    }
} public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastScanner in = new FastScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        C solver = new C();
        solver.solve(1, in, out);
        out.close();
    }

    static class C {
        public void solve(int testNumber, FastScanner in, PrintWriter out) {
            String s = in.ns();
            int n = s.length();
            int[] res = new int[2];
            for (int first = 0; first <= 1; first++) {
                int cur = first;
                for (int i = 0; i < n; i++) {
                    if (s.charAt(i) - '0' != cur)
                        res[first]++;
                    cur = 1 - cur;
                }
            }
            out.println(Math.min(res[0], res[1]));
        }

    }

    static class FastScanner {
        private BufferedReader in;
        private StringTokenizer st;

        public FastScanner(InputStream stream) {
            in = new BufferedReader(new InputStreamReader(stream));
        }

        public String ns() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    String rl = in.readLine();
                    if (rl == null) {
                        return null;
                    }
                    st = new StringTokenizer(rl);
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return st.nextToken();
        }

    }
} Main
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastScanner in = new FastScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        C solver = new C();
        solver.solve(1, in, out);
        out.close();
    }

    static class C {
        public void solve(int testNumber, FastScanner in, PrintWriter out) {
            String s = in.ns();
            int n = s.length();
            int[] res = new int[2];
            for (int first = 0; first <= 1; first++) {
                int cur = first;
                for (int i = 0; i < n; i++) {
                    if (s.charAt(i) - '0' != cur)
                        res[first]++;
                    cur = 1 - cur;
                }
            }
            out.println(Math.min(res[0], res[1]));
        }

    }

    static class FastScanner {
        private BufferedReader in;
        private StringTokenizer st;

        public FastScanner(InputStream stream) {
            in = new BufferedReader(new InputStreamReader(stream));
        }

        public String ns() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    String rl = in.readLine();
                    if (rl == null) {
                        return null;
                    }
                    st = new StringTokenizer(rl);
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return st.nextToken();
        }

    }
}

