import java.io.*;
import java.math.BigInteger;
import java.util.*;
import java.util.Map.Entry;



public class  Main{
	
	public static void main(String[] args) throws Exception{
    	MScanner sc = new MScanner(System.in);
        //MScanner sc = new MScanner("task.in");
        PrintWriter pw=new PrintWriter(System.out);
        char[]in=sc.nextLine().toCharArray();
        char cur='0';
        int ans0=0;
        for(int i=0;i<in.length;i++) {
        	if(in[i]!=cur)ans0++;
        	if(cur=='0')cur='1';
        	else	cur='0';
        }
        int ans1=0;cur='1';
        for(int i=0;i<in.length;i++) {
        	if(in[i]!=cur)ans1++;
        	if(cur=='0')cur='1';
        	else	cur='0';
        }
        pw.println(Math.min(ans0,ans1));
        pw.flush();
    }
	static class pair implements Comparable<pair>{
		int t;int d;
		pair(int x,int y){
			t=x;d=y;
		}
		@Override
		public int compareTo(pair o) {
			if(t!=o.t) {
				return t-o.t;
			}
			return d-o.d;
		}
	}
    static class MScanner {
		StringTokenizer st;
		BufferedReader br;
 
		public MScanner(InputStream system) {
			br = new BufferedReader(new InputStreamReader(system));
		}
 
		public MScanner(String file) throws Exception {
			br = new BufferedReader(new FileReader(file));
		}
 
		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}
 
		public String nextLine() throws IOException {
			return br.readLine();
		}
 
		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}
 
		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}
 
		public char nextChar() throws IOException {
			return next().charAt(0);
		}
 
		public Long nextLong() throws IOException {
			return Long.parseLong(next());
		}
 
		public boolean ready() throws IOException {
			return br.ready();
		}
 
		public void waitForInput() throws InterruptedException {
			Thread.sleep(3000);
		}
	}
} import java.io.*; io.* java import java.math.BigInteger; BigInteger java.math import java.util.*; util.* java import java.util.Map.Entry; Entry java.util.Map public class  Main{
	
	public static void main(String[] args) throws Exception{
    	MScanner sc = new MScanner(System.in);
        //MScanner sc = new MScanner("task.in");
        PrintWriter pw=new PrintWriter(System.out);
        char[]in=sc.nextLine().toCharArray();
        char cur='0';
        int ans0=0;
        for(int i=0;i<in.length;i++) {
        	if(in[i]!=cur)ans0++;
        	if(cur=='0')cur='1';
        	else	cur='0';
        }
        int ans1=0;cur='1';
        for(int i=0;i<in.length;i++) {
        	if(in[i]!=cur)ans1++;
        	if(cur=='0')cur='1';
        	else	cur='0';
        }
        pw.println(Math.min(ans0,ans1));
        pw.flush();
    }
	static class pair implements Comparable<pair>{
		int t;int d;
		pair(int x,int y){
			t=x;d=y;
		}
		@Override
		public int compareTo(pair o) {
			if(t!=o.t) {
				return t-o.t;
			}
			return d-o.d;
		}
	}
    static class MScanner {
		StringTokenizer st;
		BufferedReader br;
 
		public MScanner(InputStream system) {
			br = new BufferedReader(new InputStreamReader(system));
		}
 
		public MScanner(String file) throws Exception {
			br = new BufferedReader(new FileReader(file));
		}
 
		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}
 
		public String nextLine() throws IOException {
			return br.readLine();
		}
 
		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}
 
		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}
 
		public char nextChar() throws IOException {
			return next().charAt(0);
		}
 
		public Long nextLong() throws IOException {
			return Long.parseLong(next());
		}
 
		public boolean ready() throws IOException {
			return br.ready();
		}
 
		public void waitForInput() throws InterruptedException {
			Thread.sleep(3000);
		}
	}
} Main public static void main(String[] args) throws Exception{
    	MScanner sc = new MScanner(System.in);
        //MScanner sc = new MScanner("task.in");
        PrintWriter pw=new PrintWriter(System.out);
        char[]in=sc.nextLine().toCharArray();
        char cur='0';
        int ans0=0;
        for(int i=0;i<in.length;i++) {
        	if(in[i]!=cur)ans0++;
        	if(cur=='0')cur='1';
        	else	cur='0';
        }
        int ans1=0;cur='1';
        for(int i=0;i<in.length;i++) {
        	if(in[i]!=cur)ans1++;
        	if(cur=='0')cur='1';
        	else	cur='0';
        }
        pw.println(Math.min(ans0,ans1));
        pw.flush();
    } main {
    	MScanner sc = new MScanner(System.in);
        //MScanner sc = new MScanner("task.in");
        PrintWriter pw=new PrintWriter(System.out);
        char[]in=sc.nextLine().toCharArray();
        char cur='0';
        int ans0=0;
        for(int i=0;i<in.length;i++) {
        	if(in[i]!=cur)ans0++;
        	if(cur=='0')cur='1';
        	else	cur='0';
        }
        int ans1=0;cur='1';
        for(int i=0;i<in.length;i++) {
        	if(in[i]!=cur)ans1++;
        	if(cur=='0')cur='1';
        	else	cur='0';
        }
        pw.println(Math.min(ans0,ans1));
        pw.flush();
    } MScanner sc = new MScanner(System.in); sc new MScanner(System.in) PrintWriter pw=new PrintWriter(System.out); pw new PrintWriter(System.out) char[]in=sc.nextLine().toCharArray(); in sc.nextLine().toCharArray() sc.nextLine().toCharArray sc.nextLine() sc.nextLine sc char cur='0'; cur '0' int ans0=0; ans0 0 for(int i=0;i<in.length;i++) {
        	if(in[i]!=cur)ans0++;
        	if(cur=='0')cur='1';
        	else	cur='0';
        } int i=0; int i=0; i 0 i<in.length i in.length in in.length i++ i++ i {
        	if(in[i]!=cur)ans0++;
        	if(cur=='0')cur='1';
        	else	cur='0';
        } {
        	if(in[i]!=cur)ans0++;
        	if(cur=='0')cur='1';
        	else	cur='0';
        } if(in[i]!=cur)ans0++; in[i]!=cur in[i] in i cur ans0++ ans0 if(cur=='0')cur='1';
        	else	cur='0'; cur=='0' cur '0' cur='1' cur '1' cur='0' cur '0' int ans1=0; ans1 0 cur='1' cur '1' for(int i=0;i<in.length;i++) {
        	if(in[i]!=cur)ans1++;
        	if(cur=='0')cur='1';
        	else	cur='0';
        } int i=0; int i=0; i 0 i<in.length i in.length in in.length i++ i++ i {
        	if(in[i]!=cur)ans1++;
        	if(cur=='0')cur='1';
        	else	cur='0';
        } {
        	if(in[i]!=cur)ans1++;
        	if(cur=='0')cur='1';
        	else	cur='0';
        } if(in[i]!=cur)ans1++; in[i]!=cur in[i] in i cur ans1++ ans1 if(cur=='0')cur='1';
        	else	cur='0'; cur=='0' cur '0' cur='1' cur '1' cur='0' cur '0' pw.println(Math.min(ans0,ans1)) pw.println pw Math.min(ans0,ans1) Math.min Math ans0 ans1 pw.flush() pw.flush pw String[] args args static class pair implements Comparable<pair>{
		int t;int d;
		pair(int x,int y){
			t=x;d=y;
		}
		@Override
		public int compareTo(pair o) {
			if(t!=o.t) {
				return t-o.t;
			}
			return d-o.d;
		}
	} pair int t; t int d; d pair(int x,int y){
			t=x;d=y;
		} pair {
			t=x;d=y;
		} t=x t x d=y d y int x x int y y @Override
		public int compareTo(pair o) {
			if(t!=o.t) {
				return t-o.t;
			}
			return d-o.d;
		} compareTo {
			if(t!=o.t) {
				return t-o.t;
			}
			return d-o.d;
		} if(t!=o.t) {
				return t-o.t;
			} t!=o.t t o.t o o.t {
				return t-o.t;
			} return t-o.t; t-o.t t o.t o o.t return d-o.d; d-o.d d o.d o o.d pair o o Comparable static class MScanner {
		StringTokenizer st;
		BufferedReader br;
 
		public MScanner(InputStream system) {
			br = new BufferedReader(new InputStreamReader(system));
		}
 
		public MScanner(String file) throws Exception {
			br = new BufferedReader(new FileReader(file));
		}
 
		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}
 
		public String nextLine() throws IOException {
			return br.readLine();
		}
 
		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}
 
		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}
 
		public char nextChar() throws IOException {
			return next().charAt(0);
		}
 
		public Long nextLong() throws IOException {
			return Long.parseLong(next());
		}
 
		public boolean ready() throws IOException {
			return br.ready();
		}
 
		public void waitForInput() throws InterruptedException {
			Thread.sleep(3000);
		}
	} MScanner StringTokenizer st; st BufferedReader br; br public MScanner(InputStream system) {
			br = new BufferedReader(new InputStreamReader(system));
		} MScanner {
			br = new BufferedReader(new InputStreamReader(system));
		} br = new BufferedReader(new InputStreamReader(system)) br new BufferedReader(new InputStreamReader(system)) InputStream system system public MScanner(String file) throws Exception {
			br = new BufferedReader(new FileReader(file));
		} MScanner {
			br = new BufferedReader(new FileReader(file));
		} br = new BufferedReader(new FileReader(file)) br new BufferedReader(new FileReader(file)) String file file public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		} next {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		} while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine()); st == null || !st.hasMoreTokens() st == null st null !st.hasMoreTokens() st.hasMoreTokens() st.hasMoreTokens st st = new StringTokenizer(br.readLine()) st new StringTokenizer(br.readLine()) return st.nextToken(); st.nextToken() st.nextToken st public String nextLine() throws IOException {
			return br.readLine();
		} nextLine {
			return br.readLine();
		} return br.readLine(); br.readLine() br.readLine br public int nextInt() throws IOException {
			return Integer.parseInt(next());
		} nextInt {
			return Integer.parseInt(next());
		} return Integer.parseInt(next()); Integer.parseInt(next()) Integer.parseInt Integer next() next public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		} nextDouble {
			return Double.parseDouble(next());
		} return Double.parseDouble(next()); Double.parseDouble(next()) Double.parseDouble Double next() next public char nextChar() throws IOException {
			return next().charAt(0);
		} nextChar {
			return next().charAt(0);
		} return next().charAt(0); next().charAt(0) next().charAt next() next 0 public Long nextLong() throws IOException {
			return Long.parseLong(next());
		} nextLong {
			return Long.parseLong(next());
		} return Long.parseLong(next()); Long.parseLong(next()) Long.parseLong Long next() next public boolean ready() throws IOException {
			return br.ready();
		} ready {
			return br.ready();
		} return br.ready(); br.ready() br.ready br public void waitForInput() throws InterruptedException {
			Thread.sleep(3000);
		} waitForInput {
			Thread.sleep(3000);
		} Thread.sleep(3000) Thread.sleep Thread 3000 public class  Main{
	
	public static void main(String[] args) throws Exception{
    	MScanner sc = new MScanner(System.in);
        //MScanner sc = new MScanner("task.in");
        PrintWriter pw=new PrintWriter(System.out);
        char[]in=sc.nextLine().toCharArray();
        char cur='0';
        int ans0=0;
        for(int i=0;i<in.length;i++) {
        	if(in[i]!=cur)ans0++;
        	if(cur=='0')cur='1';
        	else	cur='0';
        }
        int ans1=0;cur='1';
        for(int i=0;i<in.length;i++) {
        	if(in[i]!=cur)ans1++;
        	if(cur=='0')cur='1';
        	else	cur='0';
        }
        pw.println(Math.min(ans0,ans1));
        pw.flush();
    }
	static class pair implements Comparable<pair>{
		int t;int d;
		pair(int x,int y){
			t=x;d=y;
		}
		@Override
		public int compareTo(pair o) {
			if(t!=o.t) {
				return t-o.t;
			}
			return d-o.d;
		}
	}
    static class MScanner {
		StringTokenizer st;
		BufferedReader br;
 
		public MScanner(InputStream system) {
			br = new BufferedReader(new InputStreamReader(system));
		}
 
		public MScanner(String file) throws Exception {
			br = new BufferedReader(new FileReader(file));
		}
 
		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}
 
		public String nextLine() throws IOException {
			return br.readLine();
		}
 
		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}
 
		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}
 
		public char nextChar() throws IOException {
			return next().charAt(0);
		}
 
		public Long nextLong() throws IOException {
			return Long.parseLong(next());
		}
 
		public boolean ready() throws IOException {
			return br.ready();
		}
 
		public void waitForInput() throws InterruptedException {
			Thread.sleep(3000);
		}
	}
} public class  Main{
	
	public static void main(String[] args) throws Exception{
    	MScanner sc = new MScanner(System.in);
        //MScanner sc = new MScanner("task.in");
        PrintWriter pw=new PrintWriter(System.out);
        char[]in=sc.nextLine().toCharArray();
        char cur='0';
        int ans0=0;
        for(int i=0;i<in.length;i++) {
        	if(in[i]!=cur)ans0++;
        	if(cur=='0')cur='1';
        	else	cur='0';
        }
        int ans1=0;cur='1';
        for(int i=0;i<in.length;i++) {
        	if(in[i]!=cur)ans1++;
        	if(cur=='0')cur='1';
        	else	cur='0';
        }
        pw.println(Math.min(ans0,ans1));
        pw.flush();
    }
	static class pair implements Comparable<pair>{
		int t;int d;
		pair(int x,int y){
			t=x;d=y;
		}
		@Override
		public int compareTo(pair o) {
			if(t!=o.t) {
				return t-o.t;
			}
			return d-o.d;
		}
	}
    static class MScanner {
		StringTokenizer st;
		BufferedReader br;
 
		public MScanner(InputStream system) {
			br = new BufferedReader(new InputStreamReader(system));
		}
 
		public MScanner(String file) throws Exception {
			br = new BufferedReader(new FileReader(file));
		}
 
		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}
 
		public String nextLine() throws IOException {
			return br.readLine();
		}
 
		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}
 
		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}
 
		public char nextChar() throws IOException {
			return next().charAt(0);
		}
 
		public Long nextLong() throws IOException {
			return Long.parseLong(next());
		}
 
		public boolean ready() throws IOException {
			return br.ready();
		}
 
		public void waitForInput() throws InterruptedException {
			Thread.sleep(3000);
		}
	}
} Main
import java.io.*;
import java.math.BigInteger;
import java.util.*;
import java.util.Map.Entry;



public class  Main{
	
	public static void main(String[] args) throws Exception{
    	MScanner sc = new MScanner(System.in);
        //MScanner sc = new MScanner("task.in");
        PrintWriter pw=new PrintWriter(System.out);
        char[]in=sc.nextLine().toCharArray();
        char cur='0';
        int ans0=0;
        for(int i=0;i<in.length;i++) {
        	if(in[i]!=cur)ans0++;
        	if(cur=='0')cur='1';
        	else	cur='0';
        }
        int ans1=0;cur='1';
        for(int i=0;i<in.length;i++) {
        	if(in[i]!=cur)ans1++;
        	if(cur=='0')cur='1';
        	else	cur='0';
        }
        pw.println(Math.min(ans0,ans1));
        pw.flush();
    }
	static class pair implements Comparable<pair>{
		int t;int d;
		pair(int x,int y){
			t=x;d=y;
		}
		@Override
		public int compareTo(pair o) {
			if(t!=o.t) {
				return t-o.t;
			}
			return d-o.d;
		}
	}
    static class MScanner {
		StringTokenizer st;
		BufferedReader br;
 
		public MScanner(InputStream system) {
			br = new BufferedReader(new InputStreamReader(system));
		}
 
		public MScanner(String file) throws Exception {
			br = new BufferedReader(new FileReader(file));
		}
 
		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}
 
		public String nextLine() throws IOException {
			return br.readLine();
		}
 
		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}
 
		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}
 
		public char nextChar() throws IOException {
			return next().charAt(0);
		}
 
		public Long nextLong() throws IOException {
			return Long.parseLong(next());
		}
 
		public boolean ready() throws IOException {
			return br.ready();
		}
 
		public void waitForInput() throws InterruptedException {
			Thread.sleep(3000);
		}
	}
}