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
 *
 * @author Eric
 */
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);
        CColoringColorfully solver = new CColoringColorfully();
        solver.solve(1, in, out);
        out.close();
    }

    static class CColoringColorfully {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            String s = in.next();
            int nbChanges = solve0(s);
            out.println(nbChanges);
        }

        private int solve0(String s) {
            int[][] dp = new int[s.length()][2];
            dp[0][0] = s.charAt(0) == '0' ? 0 : 1;
            dp[0][1] = s.charAt(0) == '1' ? 0 : 1;
            for (int i = 1; i < s.length(); i++) {
                dp[i][0] = dp[i - 1][1] + (s.charAt(i) == '0' ? 0 : 1);
                dp[i][1] = dp[i - 1][0] + (s.charAt(i) == '1' ? 0 : 1);
            }
            int N = s.length();
            return Math.min(dp[N - 1][0], dp[N - 1][1]);
        }

    }
}
 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);
        CColoringColorfully solver = new CColoringColorfully();
        solver.solve(1, in, out);
        out.close();
    }

    static class CColoringColorfully {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            String s = in.next();
            int nbChanges = solve0(s);
            out.println(nbChanges);
        }

        private int solve0(String s) {
            int[][] dp = new int[s.length()][2];
            dp[0][0] = s.charAt(0) == '0' ? 0 : 1;
            dp[0][1] = s.charAt(0) == '1' ? 0 : 1;
            for (int i = 1; i < s.length(); i++) {
                dp[i][0] = dp[i - 1][1] + (s.charAt(i) == '0' ? 0 : 1);
                dp[i][1] = dp[i - 1][0] + (s.charAt(i) == '1' ? 0 : 1);
            }
            int N = s.length();
            return Math.min(dp[N - 1][0], dp[N - 1][1]);
        }

    }
} 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);
        CColoringColorfully solver = new CColoringColorfully();
        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);
        CColoringColorfully solver = new CColoringColorfully();
        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) CColoringColorfully solver = new CColoringColorfully(); solver new CColoringColorfully() solver.solve(1, in, out) solver.solve solver 1 in out out.close() out.close out String[] args args static class CColoringColorfully {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            String s = in.next();
            int nbChanges = solve0(s);
            out.println(nbChanges);
        }

        private int solve0(String s) {
            int[][] dp = new int[s.length()][2];
            dp[0][0] = s.charAt(0) == '0' ? 0 : 1;
            dp[0][1] = s.charAt(0) == '1' ? 0 : 1;
            for (int i = 1; i < s.length(); i++) {
                dp[i][0] = dp[i - 1][1] + (s.charAt(i) == '0' ? 0 : 1);
                dp[i][1] = dp[i - 1][0] + (s.charAt(i) == '1' ? 0 : 1);
            }
            int N = s.length();
            return Math.min(dp[N - 1][0], dp[N - 1][1]);
        }

    } CColoringColorfully public void solve(int testNumber, Scanner in, PrintWriter out) {
            String s = in.next();
            int nbChanges = solve0(s);
            out.println(nbChanges);
        } solve {
            String s = in.next();
            int nbChanges = solve0(s);
            out.println(nbChanges);
        } String s = in.next(); s in.next() in.next in int nbChanges = solve0(s); nbChanges solve0(s) solve0 s out.println(nbChanges) out.println out nbChanges int testNumber testNumber Scanner in in PrintWriter out out private int solve0(String s) {
            int[][] dp = new int[s.length()][2];
            dp[0][0] = s.charAt(0) == '0' ? 0 : 1;
            dp[0][1] = s.charAt(0) == '1' ? 0 : 1;
            for (int i = 1; i < s.length(); i++) {
                dp[i][0] = dp[i - 1][1] + (s.charAt(i) == '0' ? 0 : 1);
                dp[i][1] = dp[i - 1][0] + (s.charAt(i) == '1' ? 0 : 1);
            }
            int N = s.length();
            return Math.min(dp[N - 1][0], dp[N - 1][1]);
        } solve0 {
            int[][] dp = new int[s.length()][2];
            dp[0][0] = s.charAt(0) == '0' ? 0 : 1;
            dp[0][1] = s.charAt(0) == '1' ? 0 : 1;
            for (int i = 1; i < s.length(); i++) {
                dp[i][0] = dp[i - 1][1] + (s.charAt(i) == '0' ? 0 : 1);
                dp[i][1] = dp[i - 1][0] + (s.charAt(i) == '1' ? 0 : 1);
            }
            int N = s.length();
            return Math.min(dp[N - 1][0], dp[N - 1][1]);
        } int[][] dp = new int[s.length()][2]; dp new int[s.length()][2] s.length() s.length s 2 dp[0][0] = s.charAt(0) == '0' ? 0 : 1 dp[0][0] dp[0] dp 0 0 s.charAt(0) == '0' ? 0 : 1 s.charAt(0) == '0' s.charAt(0) s.charAt s 0 '0' 0 1 dp[0][1] = s.charAt(0) == '1' ? 0 : 1 dp[0][1] dp[0] dp 0 1 s.charAt(0) == '1' ? 0 : 1 s.charAt(0) == '1' s.charAt(0) s.charAt s 0 '1' 0 1 for (int i = 1; i < s.length(); i++) {
                dp[i][0] = dp[i - 1][1] + (s.charAt(i) == '0' ? 0 : 1);
                dp[i][1] = dp[i - 1][0] + (s.charAt(i) == '1' ? 0 : 1);
            } int i = 1; int i = 1; i 1 i < s.length() i s.length() s.length s i++ i++ i {
                dp[i][0] = dp[i - 1][1] + (s.charAt(i) == '0' ? 0 : 1);
                dp[i][1] = dp[i - 1][0] + (s.charAt(i) == '1' ? 0 : 1);
            } {
                dp[i][0] = dp[i - 1][1] + (s.charAt(i) == '0' ? 0 : 1);
                dp[i][1] = dp[i - 1][0] + (s.charAt(i) == '1' ? 0 : 1);
            } dp[i][0] = dp[i - 1][1] + (s.charAt(i) == '0' ? 0 : 1) dp[i][0] dp[i] dp i 0 dp[i - 1][1] + (s.charAt(i) == '0' ? 0 : 1) dp[i - 1][1] dp[i - 1] dp i - 1 i 1 1 (s.charAt(i) == '0' ? 0 : 1) s.charAt(i) == '0' s.charAt(i) s.charAt s i '0' 0 1 dp[i][1] = dp[i - 1][0] + (s.charAt(i) == '1' ? 0 : 1) dp[i][1] dp[i] dp i 1 dp[i - 1][0] + (s.charAt(i) == '1' ? 0 : 1) dp[i - 1][0] dp[i - 1] dp i - 1 i 1 0 (s.charAt(i) == '1' ? 0 : 1) s.charAt(i) == '1' s.charAt(i) s.charAt s i '1' 0 1 int N = s.length(); N s.length() s.length s return Math.min(dp[N - 1][0], dp[N - 1][1]); Math.min(dp[N - 1][0], dp[N - 1][1]) Math.min Math dp[N - 1][0] dp[N - 1] dp N - 1 N 1 0 dp[N - 1][1] dp[N - 1] dp N - 1 N 1 1 String s s 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);
        CColoringColorfully solver = new CColoringColorfully();
        solver.solve(1, in, out);
        out.close();
    }

    static class CColoringColorfully {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            String s = in.next();
            int nbChanges = solve0(s);
            out.println(nbChanges);
        }

        private int solve0(String s) {
            int[][] dp = new int[s.length()][2];
            dp[0][0] = s.charAt(0) == '0' ? 0 : 1;
            dp[0][1] = s.charAt(0) == '1' ? 0 : 1;
            for (int i = 1; i < s.length(); i++) {
                dp[i][0] = dp[i - 1][1] + (s.charAt(i) == '0' ? 0 : 1);
                dp[i][1] = dp[i - 1][0] + (s.charAt(i) == '1' ? 0 : 1);
            }
            int N = s.length();
            return Math.min(dp[N - 1][0], dp[N - 1][1]);
        }

    }
} 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);
        CColoringColorfully solver = new CColoringColorfully();
        solver.solve(1, in, out);
        out.close();
    }

    static class CColoringColorfully {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            String s = in.next();
            int nbChanges = solve0(s);
            out.println(nbChanges);
        }

        private int solve0(String s) {
            int[][] dp = new int[s.length()][2];
            dp[0][0] = s.charAt(0) == '0' ? 0 : 1;
            dp[0][1] = s.charAt(0) == '1' ? 0 : 1;
            for (int i = 1; i < s.length(); i++) {
                dp[i][0] = dp[i - 1][1] + (s.charAt(i) == '0' ? 0 : 1);
                dp[i][1] = dp[i - 1][0] + (s.charAt(i) == '1' ? 0 : 1);
            }
            int N = s.length();
            return Math.min(dp[N - 1][0], dp[N - 1][1]);
        }

    }
} 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
 *
 * @author Eric
 */
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);
        CColoringColorfully solver = new CColoringColorfully();
        solver.solve(1, in, out);
        out.close();
    }

    static class CColoringColorfully {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            String s = in.next();
            int nbChanges = solve0(s);
            out.println(nbChanges);
        }

        private int solve0(String s) {
            int[][] dp = new int[s.length()][2];
            dp[0][0] = s.charAt(0) == '0' ? 0 : 1;
            dp[0][1] = s.charAt(0) == '1' ? 0 : 1;
            for (int i = 1; i < s.length(); i++) {
                dp[i][0] = dp[i - 1][1] + (s.charAt(i) == '0' ? 0 : 1);
                dp[i][1] = dp[i - 1][0] + (s.charAt(i) == '1' ? 0 : 1);
            }
            int N = s.length();
            return Math.min(dp[N - 1][0], dp[N - 1][1]);
        }

    }
}

