import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * 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;
        Scanner in = new Scanner(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, Scanner in, PrintWriter out) {
            // 入力
            String S = in.next();

            StringBuilder sb1 = new StringBuilder();
            StringBuilder sb2 = new StringBuilder();
            for (int i = 0; i < S.length(); i++) {
                sb1.append(0);
                sb1.append(1);
            }
            sb1.substring(0, S.length());
            for (int i = 0; i < S.length(); i++) {
                sb2.append(1);
                sb2.append(0);
            }
            sb2.substring(0, S.length());

            long cnt1 = 0;
            long cnt2 = 0;
            for (int i = 0; i < S.length(); i++) {
                if (S.charAt(i) != sb1.charAt(i)) cnt1++;
                if (S.charAt(i) != sb2.charAt(i)) cnt2++;
            }

            out.println(Math.min(cnt1, cnt2));
        }

    }
}
 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.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(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, Scanner in, PrintWriter out) {
            // 入力
            String S = in.next();

            StringBuilder sb1 = new StringBuilder();
            StringBuilder sb2 = new StringBuilder();
            for (int i = 0; i < S.length(); i++) {
                sb1.append(0);
                sb1.append(1);
            }
            sb1.substring(0, S.length());
            for (int i = 0; i < S.length(); i++) {
                sb2.append(1);
                sb2.append(0);
            }
            sb2.substring(0, S.length());

            long cnt1 = 0;
            long cnt2 = 0;
            for (int i = 0; i < S.length(); i++) {
                if (S.charAt(i) != sb1.charAt(i)) cnt1++;
                if (S.charAt(i) != sb2.charAt(i)) cnt2++;
            }

            out.println(Math.min(cnt1, cnt2));
        }

    }
} Main public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(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;
        Scanner in = new Scanner(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 Scanner in = new Scanner(inputStream); in new Scanner(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, Scanner in, PrintWriter out) {
            // 入力
            String S = in.next();

            StringBuilder sb1 = new StringBuilder();
            StringBuilder sb2 = new StringBuilder();
            for (int i = 0; i < S.length(); i++) {
                sb1.append(0);
                sb1.append(1);
            }
            sb1.substring(0, S.length());
            for (int i = 0; i < S.length(); i++) {
                sb2.append(1);
                sb2.append(0);
            }
            sb2.substring(0, S.length());

            long cnt1 = 0;
            long cnt2 = 0;
            for (int i = 0; i < S.length(); i++) {
                if (S.charAt(i) != sb1.charAt(i)) cnt1++;
                if (S.charAt(i) != sb2.charAt(i)) cnt2++;
            }

            out.println(Math.min(cnt1, cnt2));
        }

    } C public void solve(int testNumber, Scanner in, PrintWriter out) {
            // 入力
            String S = in.next();

            StringBuilder sb1 = new StringBuilder();
            StringBuilder sb2 = new StringBuilder();
            for (int i = 0; i < S.length(); i++) {
                sb1.append(0);
                sb1.append(1);
            }
            sb1.substring(0, S.length());
            for (int i = 0; i < S.length(); i++) {
                sb2.append(1);
                sb2.append(0);
            }
            sb2.substring(0, S.length());

            long cnt1 = 0;
            long cnt2 = 0;
            for (int i = 0; i < S.length(); i++) {
                if (S.charAt(i) != sb1.charAt(i)) cnt1++;
                if (S.charAt(i) != sb2.charAt(i)) cnt2++;
            }

            out.println(Math.min(cnt1, cnt2));
        } solve {
            // 入力
            String S = in.next();

            StringBuilder sb1 = new StringBuilder();
            StringBuilder sb2 = new StringBuilder();
            for (int i = 0; i < S.length(); i++) {
                sb1.append(0);
                sb1.append(1);
            }
            sb1.substring(0, S.length());
            for (int i = 0; i < S.length(); i++) {
                sb2.append(1);
                sb2.append(0);
            }
            sb2.substring(0, S.length());

            long cnt1 = 0;
            long cnt2 = 0;
            for (int i = 0; i < S.length(); i++) {
                if (S.charAt(i) != sb1.charAt(i)) cnt1++;
                if (S.charAt(i) != sb2.charAt(i)) cnt2++;
            }

            out.println(Math.min(cnt1, cnt2));
        } String S = in.next(); S in.next() in.next in StringBuilder sb1 = new StringBuilder(); sb1 new StringBuilder() StringBuilder sb2 = new StringBuilder(); sb2 new StringBuilder() for (int i = 0; i < S.length(); i++) {
                sb1.append(0);
                sb1.append(1);
            } int i = 0; int i = 0; i 0 i < S.length() i S.length() S.length S i++ i++ i {
                sb1.append(0);
                sb1.append(1);
            } {
                sb1.append(0);
                sb1.append(1);
            } sb1.append(0) sb1.append sb1 0 sb1.append(1) sb1.append sb1 1 sb1.substring(0, S.length()) sb1.substring sb1 0 S.length() S.length S for (int i = 0; i < S.length(); i++) {
                sb2.append(1);
                sb2.append(0);
            } int i = 0; int i = 0; i 0 i < S.length() i S.length() S.length S i++ i++ i {
                sb2.append(1);
                sb2.append(0);
            } {
                sb2.append(1);
                sb2.append(0);
            } sb2.append(1) sb2.append sb2 1 sb2.append(0) sb2.append sb2 0 sb2.substring(0, S.length()) sb2.substring sb2 0 S.length() S.length S long cnt1 = 0; cnt1 0 long cnt2 = 0; cnt2 0 for (int i = 0; i < S.length(); i++) {
                if (S.charAt(i) != sb1.charAt(i)) cnt1++;
                if (S.charAt(i) != sb2.charAt(i)) cnt2++;
            } int i = 0; int i = 0; i 0 i < S.length() i S.length() S.length S i++ i++ i {
                if (S.charAt(i) != sb1.charAt(i)) cnt1++;
                if (S.charAt(i) != sb2.charAt(i)) cnt2++;
            } {
                if (S.charAt(i) != sb1.charAt(i)) cnt1++;
                if (S.charAt(i) != sb2.charAt(i)) cnt2++;
            } if (S.charAt(i) != sb1.charAt(i)) cnt1++; S.charAt(i) != sb1.charAt(i) S.charAt(i) S.charAt S i sb1.charAt(i) sb1.charAt sb1 i cnt1++ cnt1 if (S.charAt(i) != sb2.charAt(i)) cnt2++; S.charAt(i) != sb2.charAt(i) S.charAt(i) S.charAt S i sb2.charAt(i) sb2.charAt sb2 i cnt2++ cnt2 out.println(Math.min(cnt1, cnt2)) out.println out Math.min(cnt1, cnt2) Math.min Math cnt1 cnt2 int testNumber testNumber Scanner in in PrintWriter out out public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(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, Scanner in, PrintWriter out) {
            // 入力
            String S = in.next();

            StringBuilder sb1 = new StringBuilder();
            StringBuilder sb2 = new StringBuilder();
            for (int i = 0; i < S.length(); i++) {
                sb1.append(0);
                sb1.append(1);
            }
            sb1.substring(0, S.length());
            for (int i = 0; i < S.length(); i++) {
                sb2.append(1);
                sb2.append(0);
            }
            sb2.substring(0, S.length());

            long cnt1 = 0;
            long cnt2 = 0;
            for (int i = 0; i < S.length(); i++) {
                if (S.charAt(i) != sb1.charAt(i)) cnt1++;
                if (S.charAt(i) != sb2.charAt(i)) cnt2++;
            }

            out.println(Math.min(cnt1, cnt2));
        }

    }
} public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(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, Scanner in, PrintWriter out) {
            // 入力
            String S = in.next();

            StringBuilder sb1 = new StringBuilder();
            StringBuilder sb2 = new StringBuilder();
            for (int i = 0; i < S.length(); i++) {
                sb1.append(0);
                sb1.append(1);
            }
            sb1.substring(0, S.length());
            for (int i = 0; i < S.length(); i++) {
                sb2.append(1);
                sb2.append(0);
            }
            sb2.substring(0, S.length());

            long cnt1 = 0;
            long cnt2 = 0;
            for (int i = 0; i < S.length(); i++) {
                if (S.charAt(i) != sb1.charAt(i)) cnt1++;
                if (S.charAt(i) != sb2.charAt(i)) cnt2++;
            }

            out.println(Math.min(cnt1, cnt2));
        }

    }
} Main
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * 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;
        Scanner in = new Scanner(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, Scanner in, PrintWriter out) {
            // 入力
            String S = in.next();

            StringBuilder sb1 = new StringBuilder();
            StringBuilder sb2 = new StringBuilder();
            for (int i = 0; i < S.length(); i++) {
                sb1.append(0);
                sb1.append(1);
            }
            sb1.substring(0, S.length());
            for (int i = 0; i < S.length(); i++) {
                sb2.append(1);
                sb2.append(0);
            }
            sb2.substring(0, S.length());

            long cnt1 = 0;
            long cnt2 = 0;
            for (int i = 0; i < S.length(); i++) {
                if (S.charAt(i) != sb1.charAt(i)) cnt1++;
                if (S.charAt(i) != sb2.charAt(i)) cnt2++;
            }

            out.println(Math.min(cnt1, cnt2));
        }

    }
}

