import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
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
 *
 * @author Washoum
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        inputClass in = new inputClass(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, inputClass sc, PrintWriter out) {
            String s = sc.nextLine();
            int nb0 = 0;
            int nb1 = 0;
            int tawa1 = 0;
            int tawa2 = 1;
            for (int i = 0; i < s.length(); i++) {
                if (s.charAt(i) - '0' != tawa1) {
                    nb0++;
                }
                if (s.charAt(i) - '0' != tawa2) {
                    nb1++;
                }
                tawa1 = (tawa1 + 1) % 2;
                tawa2 = (tawa2 + 1) % 2;
            }
            out.println(Math.min(nb0, nb1));
        }

    }

    static class inputClass {
        BufferedReader br;

        public inputClass(InputStream in) {

            br = new BufferedReader(new InputStreamReader(in));
        }

        public String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

    }
}
 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.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;
        inputClass in = new inputClass(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, inputClass sc, PrintWriter out) {
            String s = sc.nextLine();
            int nb0 = 0;
            int nb1 = 0;
            int tawa1 = 0;
            int tawa2 = 1;
            for (int i = 0; i < s.length(); i++) {
                if (s.charAt(i) - '0' != tawa1) {
                    nb0++;
                }
                if (s.charAt(i) - '0' != tawa2) {
                    nb1++;
                }
                tawa1 = (tawa1 + 1) % 2;
                tawa2 = (tawa2 + 1) % 2;
            }
            out.println(Math.min(nb0, nb1));
        }

    }

    static class inputClass {
        BufferedReader br;

        public inputClass(InputStream in) {

            br = new BufferedReader(new InputStreamReader(in));
        }

        public String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

    }
} Main public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        inputClass in = new inputClass(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;
        inputClass in = new inputClass(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 inputClass in = new inputClass(inputStream); in new inputClass(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, inputClass sc, PrintWriter out) {
            String s = sc.nextLine();
            int nb0 = 0;
            int nb1 = 0;
            int tawa1 = 0;
            int tawa2 = 1;
            for (int i = 0; i < s.length(); i++) {
                if (s.charAt(i) - '0' != tawa1) {
                    nb0++;
                }
                if (s.charAt(i) - '0' != tawa2) {
                    nb1++;
                }
                tawa1 = (tawa1 + 1) % 2;
                tawa2 = (tawa2 + 1) % 2;
            }
            out.println(Math.min(nb0, nb1));
        }

    } CColoringColorfully public void solve(int testNumber, inputClass sc, PrintWriter out) {
            String s = sc.nextLine();
            int nb0 = 0;
            int nb1 = 0;
            int tawa1 = 0;
            int tawa2 = 1;
            for (int i = 0; i < s.length(); i++) {
                if (s.charAt(i) - '0' != tawa1) {
                    nb0++;
                }
                if (s.charAt(i) - '0' != tawa2) {
                    nb1++;
                }
                tawa1 = (tawa1 + 1) % 2;
                tawa2 = (tawa2 + 1) % 2;
            }
            out.println(Math.min(nb0, nb1));
        } solve {
            String s = sc.nextLine();
            int nb0 = 0;
            int nb1 = 0;
            int tawa1 = 0;
            int tawa2 = 1;
            for (int i = 0; i < s.length(); i++) {
                if (s.charAt(i) - '0' != tawa1) {
                    nb0++;
                }
                if (s.charAt(i) - '0' != tawa2) {
                    nb1++;
                }
                tawa1 = (tawa1 + 1) % 2;
                tawa2 = (tawa2 + 1) % 2;
            }
            out.println(Math.min(nb0, nb1));
        } String s = sc.nextLine(); s sc.nextLine() sc.nextLine sc int nb0 = 0; nb0 0 int nb1 = 0; nb1 0 int tawa1 = 0; tawa1 0 int tawa2 = 1; tawa2 1 for (int i = 0; i < s.length(); i++) {
                if (s.charAt(i) - '0' != tawa1) {
                    nb0++;
                }
                if (s.charAt(i) - '0' != tawa2) {
                    nb1++;
                }
                tawa1 = (tawa1 + 1) % 2;
                tawa2 = (tawa2 + 1) % 2;
            } int i = 0; int i = 0; i 0 i < s.length() i s.length() s.length s i++ i++ i {
                if (s.charAt(i) - '0' != tawa1) {
                    nb0++;
                }
                if (s.charAt(i) - '0' != tawa2) {
                    nb1++;
                }
                tawa1 = (tawa1 + 1) % 2;
                tawa2 = (tawa2 + 1) % 2;
            } {
                if (s.charAt(i) - '0' != tawa1) {
                    nb0++;
                }
                if (s.charAt(i) - '0' != tawa2) {
                    nb1++;
                }
                tawa1 = (tawa1 + 1) % 2;
                tawa2 = (tawa2 + 1) % 2;
            } if (s.charAt(i) - '0' != tawa1) {
                    nb0++;
                } s.charAt(i) - '0' != tawa1 s.charAt(i) - '0' s.charAt(i) s.charAt s i '0' tawa1 {
                    nb0++;
                } nb0++ nb0 if (s.charAt(i) - '0' != tawa2) {
                    nb1++;
                } s.charAt(i) - '0' != tawa2 s.charAt(i) - '0' s.charAt(i) s.charAt s i '0' tawa2 {
                    nb1++;
                } nb1++ nb1 tawa1 = (tawa1 + 1) % 2 tawa1 (tawa1 + 1) % 2 (tawa1 + 1) tawa1 1 2 tawa2 = (tawa2 + 1) % 2 tawa2 (tawa2 + 1) % 2 (tawa2 + 1) tawa2 1 2 out.println(Math.min(nb0, nb1)) out.println out Math.min(nb0, nb1) Math.min Math nb0 nb1 int testNumber testNumber inputClass sc sc PrintWriter out out static class inputClass {
        BufferedReader br;

        public inputClass(InputStream in) {

            br = new BufferedReader(new InputStreamReader(in));
        }

        public String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

    } inputClass BufferedReader br; br public inputClass(InputStream in) {

            br = new BufferedReader(new InputStreamReader(in));
        } inputClass {

            br = new BufferedReader(new InputStreamReader(in));
        } br = new BufferedReader(new InputStreamReader(in)) br new BufferedReader(new InputStreamReader(in)) InputStream in in public String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        } nextLine {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        } String str = ""; str "" try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            } catch (IOException e) {
                e.printStackTrace();
            } IOException e {
                e.printStackTrace();
            } e.printStackTrace() e.printStackTrace e {
                str = br.readLine();
            } str = br.readLine() str br.readLine() br.readLine br return str; str public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        inputClass in = new inputClass(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, inputClass sc, PrintWriter out) {
            String s = sc.nextLine();
            int nb0 = 0;
            int nb1 = 0;
            int tawa1 = 0;
            int tawa2 = 1;
            for (int i = 0; i < s.length(); i++) {
                if (s.charAt(i) - '0' != tawa1) {
                    nb0++;
                }
                if (s.charAt(i) - '0' != tawa2) {
                    nb1++;
                }
                tawa1 = (tawa1 + 1) % 2;
                tawa2 = (tawa2 + 1) % 2;
            }
            out.println(Math.min(nb0, nb1));
        }

    }

    static class inputClass {
        BufferedReader br;

        public inputClass(InputStream in) {

            br = new BufferedReader(new InputStreamReader(in));
        }

        public String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

    }
} public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        inputClass in = new inputClass(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, inputClass sc, PrintWriter out) {
            String s = sc.nextLine();
            int nb0 = 0;
            int nb1 = 0;
            int tawa1 = 0;
            int tawa2 = 1;
            for (int i = 0; i < s.length(); i++) {
                if (s.charAt(i) - '0' != tawa1) {
                    nb0++;
                }
                if (s.charAt(i) - '0' != tawa2) {
                    nb1++;
                }
                tawa1 = (tawa1 + 1) % 2;
                tawa2 = (tawa2 + 1) % 2;
            }
            out.println(Math.min(nb0, nb1));
        }

    }

    static class inputClass {
        BufferedReader br;

        public inputClass(InputStream in) {

            br = new BufferedReader(new InputStreamReader(in));
        }

        public String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

    }
} Main
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
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
 *
 * @author Washoum
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        inputClass in = new inputClass(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, inputClass sc, PrintWriter out) {
            String s = sc.nextLine();
            int nb0 = 0;
            int nb1 = 0;
            int tawa1 = 0;
            int tawa2 = 1;
            for (int i = 0; i < s.length(); i++) {
                if (s.charAt(i) - '0' != tawa1) {
                    nb0++;
                }
                if (s.charAt(i) - '0' != tawa2) {
                    nb1++;
                }
                tawa1 = (tawa1 + 1) % 2;
                tawa2 = (tawa2 + 1) % 2;
            }
            out.println(Math.min(nb0, nb1));
        }

    }

    static class inputClass {
        BufferedReader br;

        public inputClass(InputStream in) {

            br = new BufferedReader(new InputStreamReader(in));
        }

        public String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

    }
}

