import java.util.*;
import java.io.*;

public class Main {
    public static void main(String[] args) {
        FastScanner s = new FastScanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        long cnt01 = 0, cnt10 = 0;

        String str = s.next();
        for (int i = 0; i < str.length(); i++) {
            if (i%2==0) {
                if (str.charAt(i)=='0') {
                    cnt10++;
                } else {
                    cnt01++;
                }
            } else {
                if (str.charAt(i)=='1') {
                    cnt10++;
                } else {
                    cnt01++;
                }
            }
        }
        out.println(Math.min(cnt01, cnt10));

        out.close();
    }

    static class FastScanner {
		
		BufferedReader br; StringTokenizer st;
		FastScanner(InputStream is) {
			br = new BufferedReader(new InputStreamReader(is));
			st = new StringTokenizer("");
		}
		String next() {
			while(!st.hasMoreElements()) {
				try { st = new StringTokenizer(br.readLine()); }
				catch(Exception e) {}
			}
			return st.nextToken();
		}
		
        int nextInt() { return Integer.parseInt(next()); }
        long nextLong() {return Long.parseLong(next()); }
		
	}
} import java.util.*; util.* java import java.io.*; io.* java public class Main {
    public static void main(String[] args) {
        FastScanner s = new FastScanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        long cnt01 = 0, cnt10 = 0;

        String str = s.next();
        for (int i = 0; i < str.length(); i++) {
            if (i%2==0) {
                if (str.charAt(i)=='0') {
                    cnt10++;
                } else {
                    cnt01++;
                }
            } else {
                if (str.charAt(i)=='1') {
                    cnt10++;
                } else {
                    cnt01++;
                }
            }
        }
        out.println(Math.min(cnt01, cnt10));

        out.close();
    }

    static class FastScanner {
		
		BufferedReader br; StringTokenizer st;
		FastScanner(InputStream is) {
			br = new BufferedReader(new InputStreamReader(is));
			st = new StringTokenizer("");
		}
		String next() {
			while(!st.hasMoreElements()) {
				try { st = new StringTokenizer(br.readLine()); }
				catch(Exception e) {}
			}
			return st.nextToken();
		}
		
        int nextInt() { return Integer.parseInt(next()); }
        long nextLong() {return Long.parseLong(next()); }
		
	}
} Main public static void main(String[] args) {
        FastScanner s = new FastScanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        long cnt01 = 0, cnt10 = 0;

        String str = s.next();
        for (int i = 0; i < str.length(); i++) {
            if (i%2==0) {
                if (str.charAt(i)=='0') {
                    cnt10++;
                } else {
                    cnt01++;
                }
            } else {
                if (str.charAt(i)=='1') {
                    cnt10++;
                } else {
                    cnt01++;
                }
            }
        }
        out.println(Math.min(cnt01, cnt10));

        out.close();
    } main {
        FastScanner s = new FastScanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        long cnt01 = 0, cnt10 = 0;

        String str = s.next();
        for (int i = 0; i < str.length(); i++) {
            if (i%2==0) {
                if (str.charAt(i)=='0') {
                    cnt10++;
                } else {
                    cnt01++;
                }
            } else {
                if (str.charAt(i)=='1') {
                    cnt10++;
                } else {
                    cnt01++;
                }
            }
        }
        out.println(Math.min(cnt01, cnt10));

        out.close();
    } FastScanner s = new FastScanner(System.in); s new FastScanner(System.in) PrintWriter out = new PrintWriter(System.out); out new PrintWriter(System.out) long cnt01 = 0 cnt01 0 cnt10 = 0; cnt10 0 String str = s.next(); str s.next() s.next s for (int i = 0; i < str.length(); i++) {
            if (i%2==0) {
                if (str.charAt(i)=='0') {
                    cnt10++;
                } else {
                    cnt01++;
                }
            } else {
                if (str.charAt(i)=='1') {
                    cnt10++;
                } else {
                    cnt01++;
                }
            }
        } int i = 0; int i = 0; i 0 i < str.length() i str.length() str.length str i++ i++ i {
            if (i%2==0) {
                if (str.charAt(i)=='0') {
                    cnt10++;
                } else {
                    cnt01++;
                }
            } else {
                if (str.charAt(i)=='1') {
                    cnt10++;
                } else {
                    cnt01++;
                }
            }
        } {
            if (i%2==0) {
                if (str.charAt(i)=='0') {
                    cnt10++;
                } else {
                    cnt01++;
                }
            } else {
                if (str.charAt(i)=='1') {
                    cnt10++;
                } else {
                    cnt01++;
                }
            }
        } if (i%2==0) {
                if (str.charAt(i)=='0') {
                    cnt10++;
                } else {
                    cnt01++;
                }
            } else {
                if (str.charAt(i)=='1') {
                    cnt10++;
                } else {
                    cnt01++;
                }
            } i%2==0 i%2 i 2 0 {
                if (str.charAt(i)=='0') {
                    cnt10++;
                } else {
                    cnt01++;
                }
            } if (str.charAt(i)=='0') {
                    cnt10++;
                } else {
                    cnt01++;
                } str.charAt(i)=='0' str.charAt(i) str.charAt str i '0' {
                    cnt10++;
                } cnt10++ cnt10 {
                    cnt01++;
                } cnt01++ cnt01 {
                if (str.charAt(i)=='1') {
                    cnt10++;
                } else {
                    cnt01++;
                }
            } if (str.charAt(i)=='1') {
                    cnt10++;
                } else {
                    cnt01++;
                } str.charAt(i)=='1' str.charAt(i) str.charAt str i '1' {
                    cnt10++;
                } cnt10++ cnt10 {
                    cnt01++;
                } cnt01++ cnt01 out.println(Math.min(cnt01, cnt10)) out.println out Math.min(cnt01, cnt10) Math.min Math cnt01 cnt10 out.close() out.close out String[] args args static class FastScanner {
		
		BufferedReader br; StringTokenizer st;
		FastScanner(InputStream is) {
			br = new BufferedReader(new InputStreamReader(is));
			st = new StringTokenizer("");
		}
		String next() {
			while(!st.hasMoreElements()) {
				try { st = new StringTokenizer(br.readLine()); }
				catch(Exception e) {}
			}
			return st.nextToken();
		}
		
        int nextInt() { return Integer.parseInt(next()); }
        long nextLong() {return Long.parseLong(next()); }
		
	} FastScanner BufferedReader br; br StringTokenizer st; st FastScanner(InputStream is) {
			br = new BufferedReader(new InputStreamReader(is));
			st = new StringTokenizer("");
		} FastScanner {
			br = new BufferedReader(new InputStreamReader(is));
			st = new StringTokenizer("");
		} br = new BufferedReader(new InputStreamReader(is)) br new BufferedReader(new InputStreamReader(is)) st = new StringTokenizer("") st new StringTokenizer("") InputStream is is String next() {
			while(!st.hasMoreElements()) {
				try { st = new StringTokenizer(br.readLine()); }
				catch(Exception e) {}
			}
			return st.nextToken();
		} next {
			while(!st.hasMoreElements()) {
				try { st = new StringTokenizer(br.readLine()); }
				catch(Exception e) {}
			}
			return st.nextToken();
		} while(!st.hasMoreElements()) {
				try { st = new StringTokenizer(br.readLine()); }
				catch(Exception e) {}
			} !st.hasMoreElements() st.hasMoreElements() st.hasMoreElements st {
				try { st = new StringTokenizer(br.readLine()); }
				catch(Exception e) {}
			} try { st = new StringTokenizer(br.readLine()); }
				catch(Exception e) {} catch(Exception e) {} Exception e {} { st = new StringTokenizer(br.readLine()); } st = new StringTokenizer(br.readLine()) st new StringTokenizer(br.readLine()) return st.nextToken(); st.nextToken() st.nextToken st int nextInt() { return Integer.parseInt(next()); } nextInt { return Integer.parseInt(next()); } return Integer.parseInt(next()); Integer.parseInt(next()) Integer.parseInt Integer next() next long nextLong() {return Long.parseLong(next()); } nextLong {return Long.parseLong(next()); } return Long.parseLong(next()); Long.parseLong(next()) Long.parseLong Long next() next public class Main {
    public static void main(String[] args) {
        FastScanner s = new FastScanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        long cnt01 = 0, cnt10 = 0;

        String str = s.next();
        for (int i = 0; i < str.length(); i++) {
            if (i%2==0) {
                if (str.charAt(i)=='0') {
                    cnt10++;
                } else {
                    cnt01++;
                }
            } else {
                if (str.charAt(i)=='1') {
                    cnt10++;
                } else {
                    cnt01++;
                }
            }
        }
        out.println(Math.min(cnt01, cnt10));

        out.close();
    }

    static class FastScanner {
		
		BufferedReader br; StringTokenizer st;
		FastScanner(InputStream is) {
			br = new BufferedReader(new InputStreamReader(is));
			st = new StringTokenizer("");
		}
		String next() {
			while(!st.hasMoreElements()) {
				try { st = new StringTokenizer(br.readLine()); }
				catch(Exception e) {}
			}
			return st.nextToken();
		}
		
        int nextInt() { return Integer.parseInt(next()); }
        long nextLong() {return Long.parseLong(next()); }
		
	}
} public class Main {
    public static void main(String[] args) {
        FastScanner s = new FastScanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        long cnt01 = 0, cnt10 = 0;

        String str = s.next();
        for (int i = 0; i < str.length(); i++) {
            if (i%2==0) {
                if (str.charAt(i)=='0') {
                    cnt10++;
                } else {
                    cnt01++;
                }
            } else {
                if (str.charAt(i)=='1') {
                    cnt10++;
                } else {
                    cnt01++;
                }
            }
        }
        out.println(Math.min(cnt01, cnt10));

        out.close();
    }

    static class FastScanner {
		
		BufferedReader br; StringTokenizer st;
		FastScanner(InputStream is) {
			br = new BufferedReader(new InputStreamReader(is));
			st = new StringTokenizer("");
		}
		String next() {
			while(!st.hasMoreElements()) {
				try { st = new StringTokenizer(br.readLine()); }
				catch(Exception e) {}
			}
			return st.nextToken();
		}
		
        int nextInt() { return Integer.parseInt(next()); }
        long nextLong() {return Long.parseLong(next()); }
		
	}
} Main
import java.util.*;
import java.io.*;

public class Main {
    public static void main(String[] args) {
        FastScanner s = new FastScanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        long cnt01 = 0, cnt10 = 0;

        String str = s.next();
        for (int i = 0; i < str.length(); i++) {
            if (i%2==0) {
                if (str.charAt(i)=='0') {
                    cnt10++;
                } else {
                    cnt01++;
                }
            } else {
                if (str.charAt(i)=='1') {
                    cnt10++;
                } else {
                    cnt01++;
                }
            }
        }
        out.println(Math.min(cnt01, cnt10));

        out.close();
    }

    static class FastScanner {
		
		BufferedReader br; StringTokenizer st;
		FastScanner(InputStream is) {
			br = new BufferedReader(new InputStreamReader(is));
			st = new StringTokenizer("");
		}
		String next() {
			while(!st.hasMoreElements()) {
				try { st = new StringTokenizer(br.readLine()); }
				catch(Exception e) {}
			}
			return st.nextToken();
		}
		
        int nextInt() { return Integer.parseInt(next()); }
        long nextLong() {return Long.parseLong(next()); }
		
	}
}