//Atcoder
import java.io.*;
import java.util.*;

public class Main {

	static class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        public FastScanner() {
            try {
                br = new BufferedReader(new InputStreamReader(System.in));
                st = new StringTokenizer(br.readLine());
            } catch (Exception e){e.printStackTrace();}
        }

        public String next() {
            if (st.hasMoreTokens()) return st.nextToken();
            try {st = new StringTokenizer(br.readLine());}
            catch (Exception e) {e.printStackTrace();}
            return st.nextToken();
        }

        public int nextInt() {return Integer.parseInt(next());}

        public long nextLong() {return Long.parseLong(next());}

        public double nextDouble() {return Double.parseDouble(next());}

        public String nextLine() {
            String line = "";
            if(st.hasMoreTokens()) line = st.nextToken();
            else try {return br.readLine();}catch(IOException e){e.printStackTrace();}
            while(st.hasMoreTokens()) line += " "+st.nextToken();
            return line;
        }
    }

	public static void main(String[] args) {
        FastScanner sc = new FastScanner();
        PrintWriter pw = new PrintWriter(System.out);

        String str = sc.nextLine();
        int len = str.length();
        int cnt1 = 0, cnt2 = 0;
        for(int i=0;i<len;i++) {
            char c = str.charAt(i);
            if(i % 2 == 0) {
                if(c == '0') cnt1++;
                else cnt2++;
            }
            else {
                if(c == '0') cnt2++;
                else cnt1++;
            }
        }

        pw.println(Math.min(cnt1, cnt2));
        pw.close();
    }
} import java.io.*; io.* java import java.util.*; util.* java public class Main {

	static class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        public FastScanner() {
            try {
                br = new BufferedReader(new InputStreamReader(System.in));
                st = new StringTokenizer(br.readLine());
            } catch (Exception e){e.printStackTrace();}
        }

        public String next() {
            if (st.hasMoreTokens()) return st.nextToken();
            try {st = new StringTokenizer(br.readLine());}
            catch (Exception e) {e.printStackTrace();}
            return st.nextToken();
        }

        public int nextInt() {return Integer.parseInt(next());}

        public long nextLong() {return Long.parseLong(next());}

        public double nextDouble() {return Double.parseDouble(next());}

        public String nextLine() {
            String line = "";
            if(st.hasMoreTokens()) line = st.nextToken();
            else try {return br.readLine();}catch(IOException e){e.printStackTrace();}
            while(st.hasMoreTokens()) line += " "+st.nextToken();
            return line;
        }
    }

	public static void main(String[] args) {
        FastScanner sc = new FastScanner();
        PrintWriter pw = new PrintWriter(System.out);

        String str = sc.nextLine();
        int len = str.length();
        int cnt1 = 0, cnt2 = 0;
        for(int i=0;i<len;i++) {
            char c = str.charAt(i);
            if(i % 2 == 0) {
                if(c == '0') cnt1++;
                else cnt2++;
            }
            else {
                if(c == '0') cnt2++;
                else cnt1++;
            }
        }

        pw.println(Math.min(cnt1, cnt2));
        pw.close();
    }
} Main public static void main(String[] args) {
        FastScanner sc = new FastScanner();
        PrintWriter pw = new PrintWriter(System.out);

        String str = sc.nextLine();
        int len = str.length();
        int cnt1 = 0, cnt2 = 0;
        for(int i=0;i<len;i++) {
            char c = str.charAt(i);
            if(i % 2 == 0) {
                if(c == '0') cnt1++;
                else cnt2++;
            }
            else {
                if(c == '0') cnt2++;
                else cnt1++;
            }
        }

        pw.println(Math.min(cnt1, cnt2));
        pw.close();
    } main {
        FastScanner sc = new FastScanner();
        PrintWriter pw = new PrintWriter(System.out);

        String str = sc.nextLine();
        int len = str.length();
        int cnt1 = 0, cnt2 = 0;
        for(int i=0;i<len;i++) {
            char c = str.charAt(i);
            if(i % 2 == 0) {
                if(c == '0') cnt1++;
                else cnt2++;
            }
            else {
                if(c == '0') cnt2++;
                else cnt1++;
            }
        }

        pw.println(Math.min(cnt1, cnt2));
        pw.close();
    } FastScanner sc = new FastScanner(); sc new FastScanner() PrintWriter pw = new PrintWriter(System.out); pw new PrintWriter(System.out) String str = sc.nextLine(); str sc.nextLine() sc.nextLine sc int len = str.length(); len str.length() str.length str int cnt1 = 0 cnt1 0 cnt2 = 0; cnt2 0 for(int i=0;i<len;i++) {
            char c = str.charAt(i);
            if(i % 2 == 0) {
                if(c == '0') cnt1++;
                else cnt2++;
            }
            else {
                if(c == '0') cnt2++;
                else cnt1++;
            }
        } int i=0; int i=0; i 0 i<len i len i++ i++ i {
            char c = str.charAt(i);
            if(i % 2 == 0) {
                if(c == '0') cnt1++;
                else cnt2++;
            }
            else {
                if(c == '0') cnt2++;
                else cnt1++;
            }
        } {
            char c = str.charAt(i);
            if(i % 2 == 0) {
                if(c == '0') cnt1++;
                else cnt2++;
            }
            else {
                if(c == '0') cnt2++;
                else cnt1++;
            }
        } char c = str.charAt(i); c str.charAt(i) str.charAt str i if(i % 2 == 0) {
                if(c == '0') cnt1++;
                else cnt2++;
            }
            else {
                if(c == '0') cnt2++;
                else cnt1++;
            } i % 2 == 0 i % 2 i 2 0 {
                if(c == '0') cnt1++;
                else cnt2++;
            } if(c == '0') cnt1++;
                else cnt2++; c == '0' c '0' cnt1++ cnt1 cnt2++ cnt2 {
                if(c == '0') cnt2++;
                else cnt1++;
            } if(c == '0') cnt2++;
                else cnt1++; c == '0' c '0' cnt2++ cnt2 cnt1++ cnt1 pw.println(Math.min(cnt1, cnt2)) pw.println pw Math.min(cnt1, cnt2) Math.min Math cnt1 cnt2 pw.close() pw.close pw String[] args args static class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        public FastScanner() {
            try {
                br = new BufferedReader(new InputStreamReader(System.in));
                st = new StringTokenizer(br.readLine());
            } catch (Exception e){e.printStackTrace();}
        }

        public String next() {
            if (st.hasMoreTokens()) return st.nextToken();
            try {st = new StringTokenizer(br.readLine());}
            catch (Exception e) {e.printStackTrace();}
            return st.nextToken();
        }

        public int nextInt() {return Integer.parseInt(next());}

        public long nextLong() {return Long.parseLong(next());}

        public double nextDouble() {return Double.parseDouble(next());}

        public String nextLine() {
            String line = "";
            if(st.hasMoreTokens()) line = st.nextToken();
            else try {return br.readLine();}catch(IOException e){e.printStackTrace();}
            while(st.hasMoreTokens()) line += " "+st.nextToken();
            return line;
        }
    } FastScanner BufferedReader br; br StringTokenizer st; st public FastScanner() {
            try {
                br = new BufferedReader(new InputStreamReader(System.in));
                st = new StringTokenizer(br.readLine());
            } catch (Exception e){e.printStackTrace();}
        } FastScanner {
            try {
                br = new BufferedReader(new InputStreamReader(System.in));
                st = new StringTokenizer(br.readLine());
            } catch (Exception e){e.printStackTrace();}
        } try {
                br = new BufferedReader(new InputStreamReader(System.in));
                st = new StringTokenizer(br.readLine());
            } catch (Exception e){e.printStackTrace();} catch (Exception e){e.printStackTrace();} Exception e {e.printStackTrace();} e.printStackTrace() e.printStackTrace e {
                br = new BufferedReader(new InputStreamReader(System.in));
                st = new StringTokenizer(br.readLine());
            } br = new BufferedReader(new InputStreamReader(System.in)) br new BufferedReader(new InputStreamReader(System.in)) st = new StringTokenizer(br.readLine()) st new StringTokenizer(br.readLine()) public String next() {
            if (st.hasMoreTokens()) return st.nextToken();
            try {st = new StringTokenizer(br.readLine());}
            catch (Exception e) {e.printStackTrace();}
            return st.nextToken();
        } next {
            if (st.hasMoreTokens()) return st.nextToken();
            try {st = new StringTokenizer(br.readLine());}
            catch (Exception e) {e.printStackTrace();}
            return st.nextToken();
        } if (st.hasMoreTokens()) return st.nextToken(); st.hasMoreTokens() st.hasMoreTokens st return st.nextToken(); st.nextToken() st.nextToken st try {st = new StringTokenizer(br.readLine());}
            catch (Exception e) {e.printStackTrace();} catch (Exception e) {e.printStackTrace();} Exception e {e.printStackTrace();} e.printStackTrace() e.printStackTrace e {st = new StringTokenizer(br.readLine());} st = new StringTokenizer(br.readLine()) st new StringTokenizer(br.readLine()) return st.nextToken(); st.nextToken() st.nextToken st public int nextInt() {return Integer.parseInt(next());} nextInt {return Integer.parseInt(next());} return Integer.parseInt(next()); Integer.parseInt(next()) Integer.parseInt Integer next() next public long nextLong() {return Long.parseLong(next());} nextLong {return Long.parseLong(next());} return Long.parseLong(next()); Long.parseLong(next()) Long.parseLong Long next() next public double nextDouble() {return Double.parseDouble(next());} nextDouble {return Double.parseDouble(next());} return Double.parseDouble(next()); Double.parseDouble(next()) Double.parseDouble Double next() next public String nextLine() {
            String line = "";
            if(st.hasMoreTokens()) line = st.nextToken();
            else try {return br.readLine();}catch(IOException e){e.printStackTrace();}
            while(st.hasMoreTokens()) line += " "+st.nextToken();
            return line;
        } nextLine {
            String line = "";
            if(st.hasMoreTokens()) line = st.nextToken();
            else try {return br.readLine();}catch(IOException e){e.printStackTrace();}
            while(st.hasMoreTokens()) line += " "+st.nextToken();
            return line;
        } String line = ""; line "" if(st.hasMoreTokens()) line = st.nextToken();
            else try {return br.readLine();}catch(IOException e){e.printStackTrace();} st.hasMoreTokens() st.hasMoreTokens st line = st.nextToken() line st.nextToken() st.nextToken st try {return br.readLine();}catch(IOException e){e.printStackTrace();} catch(IOException e){e.printStackTrace();} IOException e {e.printStackTrace();} e.printStackTrace() e.printStackTrace e {return br.readLine();} return br.readLine(); br.readLine() br.readLine br while(st.hasMoreTokens()) line += " "+st.nextToken(); st.hasMoreTokens() st.hasMoreTokens st line += " "+st.nextToken() line " "+st.nextToken() " " st.nextToken() st.nextToken st return line; line public class Main {

	static class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        public FastScanner() {
            try {
                br = new BufferedReader(new InputStreamReader(System.in));
                st = new StringTokenizer(br.readLine());
            } catch (Exception e){e.printStackTrace();}
        }

        public String next() {
            if (st.hasMoreTokens()) return st.nextToken();
            try {st = new StringTokenizer(br.readLine());}
            catch (Exception e) {e.printStackTrace();}
            return st.nextToken();
        }

        public int nextInt() {return Integer.parseInt(next());}

        public long nextLong() {return Long.parseLong(next());}

        public double nextDouble() {return Double.parseDouble(next());}

        public String nextLine() {
            String line = "";
            if(st.hasMoreTokens()) line = st.nextToken();
            else try {return br.readLine();}catch(IOException e){e.printStackTrace();}
            while(st.hasMoreTokens()) line += " "+st.nextToken();
            return line;
        }
    }

	public static void main(String[] args) {
        FastScanner sc = new FastScanner();
        PrintWriter pw = new PrintWriter(System.out);

        String str = sc.nextLine();
        int len = str.length();
        int cnt1 = 0, cnt2 = 0;
        for(int i=0;i<len;i++) {
            char c = str.charAt(i);
            if(i % 2 == 0) {
                if(c == '0') cnt1++;
                else cnt2++;
            }
            else {
                if(c == '0') cnt2++;
                else cnt1++;
            }
        }

        pw.println(Math.min(cnt1, cnt2));
        pw.close();
    }
} public class Main {

	static class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        public FastScanner() {
            try {
                br = new BufferedReader(new InputStreamReader(System.in));
                st = new StringTokenizer(br.readLine());
            } catch (Exception e){e.printStackTrace();}
        }

        public String next() {
            if (st.hasMoreTokens()) return st.nextToken();
            try {st = new StringTokenizer(br.readLine());}
            catch (Exception e) {e.printStackTrace();}
            return st.nextToken();
        }

        public int nextInt() {return Integer.parseInt(next());}

        public long nextLong() {return Long.parseLong(next());}

        public double nextDouble() {return Double.parseDouble(next());}

        public String nextLine() {
            String line = "";
            if(st.hasMoreTokens()) line = st.nextToken();
            else try {return br.readLine();}catch(IOException e){e.printStackTrace();}
            while(st.hasMoreTokens()) line += " "+st.nextToken();
            return line;
        }
    }

	public static void main(String[] args) {
        FastScanner sc = new FastScanner();
        PrintWriter pw = new PrintWriter(System.out);

        String str = sc.nextLine();
        int len = str.length();
        int cnt1 = 0, cnt2 = 0;
        for(int i=0;i<len;i++) {
            char c = str.charAt(i);
            if(i % 2 == 0) {
                if(c == '0') cnt1++;
                else cnt2++;
            }
            else {
                if(c == '0') cnt2++;
                else cnt1++;
            }
        }

        pw.println(Math.min(cnt1, cnt2));
        pw.close();
    }
} Main
//Atcoder
import java.io.*;
import java.util.*;

public class Main {

	static class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        public FastScanner() {
            try {
                br = new BufferedReader(new InputStreamReader(System.in));
                st = new StringTokenizer(br.readLine());
            } catch (Exception e){e.printStackTrace();}
        }

        public String next() {
            if (st.hasMoreTokens()) return st.nextToken();
            try {st = new StringTokenizer(br.readLine());}
            catch (Exception e) {e.printStackTrace();}
            return st.nextToken();
        }

        public int nextInt() {return Integer.parseInt(next());}

        public long nextLong() {return Long.parseLong(next());}

        public double nextDouble() {return Double.parseDouble(next());}

        public String nextLine() {
            String line = "";
            if(st.hasMoreTokens()) line = st.nextToken();
            else try {return br.readLine();}catch(IOException e){e.printStackTrace();}
            while(st.hasMoreTokens()) line += " "+st.nextToken();
            return line;
        }
    }

	public static void main(String[] args) {
        FastScanner sc = new FastScanner();
        PrintWriter pw = new PrintWriter(System.out);

        String str = sc.nextLine();
        int len = str.length();
        int cnt1 = 0, cnt2 = 0;
        for(int i=0;i<len;i++) {
            char c = str.charAt(i);
            if(i % 2 == 0) {
                if(c == '0') cnt1++;
                else cnt2++;
            }
            else {
                if(c == '0') cnt2++;
                else cnt1++;
            }
        }

        pw.println(Math.min(cnt1, cnt2));
        pw.close();
    }
}
