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 = solve(s);
            out.println(nbChanges);
        }

        private int solve(String s) {
            return Math.min(solve(s, '0'), solve(s, '1'));
        }

        private int solve(String s, char cur) {
            int nbIfStart0 = 0;
            for (int i = 0; i < s.length(); i++) {
                if (s.charAt(i) != cur) {
                    nbIfStart0++;
                }
                cur = cur == '0' ? '1' : '0';
            }
            return nbIfStart0;
        }

    }
}
 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 = solve(s);
            out.println(nbChanges);
        }

        private int solve(String s) {
            return Math.min(solve(s, '0'), solve(s, '1'));
        }

        private int solve(String s, char cur) {
            int nbIfStart0 = 0;
            for (int i = 0; i < s.length(); i++) {
                if (s.charAt(i) != cur) {
                    nbIfStart0++;
                }
                cur = cur == '0' ? '1' : '0';
            }
            return nbIfStart0;
        }

    }
} 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 = solve(s);
            out.println(nbChanges);
        }

        private int solve(String s) {
            return Math.min(solve(s, '0'), solve(s, '1'));
        }

        private int solve(String s, char cur) {
            int nbIfStart0 = 0;
            for (int i = 0; i < s.length(); i++) {
                if (s.charAt(i) != cur) {
                    nbIfStart0++;
                }
                cur = cur == '0' ? '1' : '0';
            }
            return nbIfStart0;
        }

    } CColoringColorfully public void solve(int testNumber, Scanner in, PrintWriter out) {
            String s = in.next();
            int nbChanges = solve(s);
            out.println(nbChanges);
        } solve {
            String s = in.next();
            int nbChanges = solve(s);
            out.println(nbChanges);
        } String s = in.next(); s in.next() in.next in int nbChanges = solve(s); nbChanges solve(s) solve s out.println(nbChanges) out.println out nbChanges int testNumber testNumber Scanner in in PrintWriter out out private int solve(String s) {
            return Math.min(solve(s, '0'), solve(s, '1'));
        } solve {
            return Math.min(solve(s, '0'), solve(s, '1'));
        } return Math.min(solve(s, '0'), solve(s, '1')); Math.min(solve(s, '0'), solve(s, '1')) Math.min Math solve(s, '0') solve s '0' solve(s, '1') solve s '1' String s s private int solve(String s, char cur) {
            int nbIfStart0 = 0;
            for (int i = 0; i < s.length(); i++) {
                if (s.charAt(i) != cur) {
                    nbIfStart0++;
                }
                cur = cur == '0' ? '1' : '0';
            }
            return nbIfStart0;
        } solve {
            int nbIfStart0 = 0;
            for (int i = 0; i < s.length(); i++) {
                if (s.charAt(i) != cur) {
                    nbIfStart0++;
                }
                cur = cur == '0' ? '1' : '0';
            }
            return nbIfStart0;
        } int nbIfStart0 = 0; nbIfStart0 0 for (int i = 0; i < s.length(); i++) {
                if (s.charAt(i) != cur) {
                    nbIfStart0++;
                }
                cur = cur == '0' ? '1' : '0';
            } int i = 0; int i = 0; i 0 i < s.length() i s.length() s.length s i++ i++ i {
                if (s.charAt(i) != cur) {
                    nbIfStart0++;
                }
                cur = cur == '0' ? '1' : '0';
            } {
                if (s.charAt(i) != cur) {
                    nbIfStart0++;
                }
                cur = cur == '0' ? '1' : '0';
            } if (s.charAt(i) != cur) {
                    nbIfStart0++;
                } s.charAt(i) != cur s.charAt(i) s.charAt s i cur {
                    nbIfStart0++;
                } nbIfStart0++ nbIfStart0 cur = cur == '0' ? '1' : '0' cur cur == '0' ? '1' : '0' cur == '0' cur '0' '1' '0' return nbIfStart0; nbIfStart0 String s s char cur cur 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 = solve(s);
            out.println(nbChanges);
        }

        private int solve(String s) {
            return Math.min(solve(s, '0'), solve(s, '1'));
        }

        private int solve(String s, char cur) {
            int nbIfStart0 = 0;
            for (int i = 0; i < s.length(); i++) {
                if (s.charAt(i) != cur) {
                    nbIfStart0++;
                }
                cur = cur == '0' ? '1' : '0';
            }
            return nbIfStart0;
        }

    }
} 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 = solve(s);
            out.println(nbChanges);
        }

        private int solve(String s) {
            return Math.min(solve(s, '0'), solve(s, '1'));
        }

        private int solve(String s, char cur) {
            int nbIfStart0 = 0;
            for (int i = 0; i < s.length(); i++) {
                if (s.charAt(i) != cur) {
                    nbIfStart0++;
                }
                cur = cur == '0' ? '1' : '0';
            }
            return nbIfStart0;
        }

    }
} 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 = solve(s);
            out.println(nbChanges);
        }

        private int solve(String s) {
            return Math.min(solve(s, '0'), solve(s, '1'));
        }

        private int solve(String s, char cur) {
            int nbIfStart0 = 0;
            for (int i = 0; i < s.length(); i++) {
                if (s.charAt(i) != cur) {
                    nbIfStart0++;
                }
                cur = cur == '0' ? '1' : '0';
            }
            return nbIfStart0;
        }

    }
}

