import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
	   String s = sc.nextLine(); 
	   String[] ss = s.split("");
	  sc.close();
	int n = s.length();
	
	 int z = ct(n,zero(n,s),ss);
	int o = ct(n,one(n,s),ss);
   int ans = Math.min(z,o);
	

	
	System.out.println(ans);
	 

	}
  static String[] zero(int n,String s) {
	StringBuilder aa = new StringBuilder();

		for(int i=0; i<n; i++) {
			if(i%2==0) {aa.append("0");}
			if(i%2==1) {aa.append("1");}
		}
		
	
	 String aaa = aa.toString();  
	String[]a =aaa.split("");
	 return a;
 }
 
 static String[] one(int n,String s) {
		
		StringBuilder bb = new StringBuilder();

		for(int i=0; i<n; i++) {
				if(i%2==0) {bb.append("1");}
				if(i%2==1) {bb.append("0");}
			}
		
		  String bbb = bb.toString();
		  String[]b =bbb.split("");
		 return b;
	 }
 static int ct (int n,String[]a,String[]ss) {
	 int c =0;
	 for(int i=0; i<n; i++) {
		 if(a[i].equals(ss[i])) {
		    c++;
		 }
	 }
	 
	 return c;
 }


} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
	   String s = sc.nextLine(); 
	   String[] ss = s.split("");
	  sc.close();
	int n = s.length();
	
	 int z = ct(n,zero(n,s),ss);
	int o = ct(n,one(n,s),ss);
   int ans = Math.min(z,o);
	

	
	System.out.println(ans);
	 

	}
  static String[] zero(int n,String s) {
	StringBuilder aa = new StringBuilder();

		for(int i=0; i<n; i++) {
			if(i%2==0) {aa.append("0");}
			if(i%2==1) {aa.append("1");}
		}
		
	
	 String aaa = aa.toString();  
	String[]a =aaa.split("");
	 return a;
 }
 
 static String[] one(int n,String s) {
		
		StringBuilder bb = new StringBuilder();

		for(int i=0; i<n; i++) {
				if(i%2==0) {bb.append("1");}
				if(i%2==1) {bb.append("0");}
			}
		
		  String bbb = bb.toString();
		  String[]b =bbb.split("");
		 return b;
	 }
 static int ct (int n,String[]a,String[]ss) {
	 int c =0;
	 for(int i=0; i<n; i++) {
		 if(a[i].equals(ss[i])) {
		    c++;
		 }
	 }
	 
	 return c;
 }


} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
	   String s = sc.nextLine(); 
	   String[] ss = s.split("");
	  sc.close();
	int n = s.length();
	
	 int z = ct(n,zero(n,s),ss);
	int o = ct(n,one(n,s),ss);
   int ans = Math.min(z,o);
	

	
	System.out.println(ans);
	 

	} main {
		Scanner sc = new Scanner(System.in);
	   String s = sc.nextLine(); 
	   String[] ss = s.split("");
	  sc.close();
	int n = s.length();
	
	 int z = ct(n,zero(n,s),ss);
	int o = ct(n,one(n,s),ss);
   int ans = Math.min(z,o);
	

	
	System.out.println(ans);
	 

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.nextLine(); s sc.nextLine() sc.nextLine sc String[] ss = s.split(""); ss s.split("") s.split s "" sc.close() sc.close sc int n = s.length(); n s.length() s.length s int z = ct(n,zero(n,s),ss); z ct(n,zero(n,s),ss) ct n zero(n,s) zero n s ss int o = ct(n,one(n,s),ss); o ct(n,one(n,s),ss) ct n one(n,s) one n s ss int ans = Math.min(z,o); ans Math.min(z,o) Math.min Math z o System.out.println(ans) System.out.println System.out System System.out ans String[] args args static String[] zero(int n,String s) {
	StringBuilder aa = new StringBuilder();

		for(int i=0; i<n; i++) {
			if(i%2==0) {aa.append("0");}
			if(i%2==1) {aa.append("1");}
		}
		
	
	 String aaa = aa.toString();  
	String[]a =aaa.split("");
	 return a;
 } zero {
	StringBuilder aa = new StringBuilder();

		for(int i=0; i<n; i++) {
			if(i%2==0) {aa.append("0");}
			if(i%2==1) {aa.append("1");}
		}
		
	
	 String aaa = aa.toString();  
	String[]a =aaa.split("");
	 return a;
 } StringBuilder aa = new StringBuilder(); aa new StringBuilder() for(int i=0; i<n; i++) {
			if(i%2==0) {aa.append("0");}
			if(i%2==1) {aa.append("1");}
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			if(i%2==0) {aa.append("0");}
			if(i%2==1) {aa.append("1");}
		} {
			if(i%2==0) {aa.append("0");}
			if(i%2==1) {aa.append("1");}
		} if(i%2==0) {aa.append("0");} i%2==0 i%2 i 2 0 {aa.append("0");} aa.append("0") aa.append aa "0" if(i%2==1) {aa.append("1");} i%2==1 i%2 i 2 1 {aa.append("1");} aa.append("1") aa.append aa "1" String aaa = aa.toString(); aaa aa.toString() aa.toString aa String[]a =aaa.split(""); a aaa.split("") aaa.split aaa "" return a; a int n n String s s static String[] one(int n,String s) {
		
		StringBuilder bb = new StringBuilder();

		for(int i=0; i<n; i++) {
				if(i%2==0) {bb.append("1");}
				if(i%2==1) {bb.append("0");}
			}
		
		  String bbb = bb.toString();
		  String[]b =bbb.split("");
		 return b;
	 } one {
		
		StringBuilder bb = new StringBuilder();

		for(int i=0; i<n; i++) {
				if(i%2==0) {bb.append("1");}
				if(i%2==1) {bb.append("0");}
			}
		
		  String bbb = bb.toString();
		  String[]b =bbb.split("");
		 return b;
	 } StringBuilder bb = new StringBuilder(); bb new StringBuilder() for(int i=0; i<n; i++) {
				if(i%2==0) {bb.append("1");}
				if(i%2==1) {bb.append("0");}
			} int i=0; int i=0; i 0 i<n i n i++ i++ i {
				if(i%2==0) {bb.append("1");}
				if(i%2==1) {bb.append("0");}
			} {
				if(i%2==0) {bb.append("1");}
				if(i%2==1) {bb.append("0");}
			} if(i%2==0) {bb.append("1");} i%2==0 i%2 i 2 0 {bb.append("1");} bb.append("1") bb.append bb "1" if(i%2==1) {bb.append("0");} i%2==1 i%2 i 2 1 {bb.append("0");} bb.append("0") bb.append bb "0" String bbb = bb.toString(); bbb bb.toString() bb.toString bb String[]b =bbb.split(""); b bbb.split("") bbb.split bbb "" return b; b int n n String s s static int ct (int n,String[]a,String[]ss) {
	 int c =0;
	 for(int i=0; i<n; i++) {
		 if(a[i].equals(ss[i])) {
		    c++;
		 }
	 }
	 
	 return c;
 } ct {
	 int c =0;
	 for(int i=0; i<n; i++) {
		 if(a[i].equals(ss[i])) {
		    c++;
		 }
	 }
	 
	 return c;
 } int c =0; c 0 for(int i=0; i<n; i++) {
		 if(a[i].equals(ss[i])) {
		    c++;
		 }
	 } int i=0; int i=0; i 0 i<n i n i++ i++ i {
		 if(a[i].equals(ss[i])) {
		    c++;
		 }
	 } {
		 if(a[i].equals(ss[i])) {
		    c++;
		 }
	 } if(a[i].equals(ss[i])) {
		    c++;
		 } a[i].equals(ss[i]) a[i].equals a[i] a i ss[i] ss i {
		    c++;
		 } c++ c return c; c int n n String[]a a String[]ss ss public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
	   String s = sc.nextLine(); 
	   String[] ss = s.split("");
	  sc.close();
	int n = s.length();
	
	 int z = ct(n,zero(n,s),ss);
	int o = ct(n,one(n,s),ss);
   int ans = Math.min(z,o);
	

	
	System.out.println(ans);
	 

	}
  static String[] zero(int n,String s) {
	StringBuilder aa = new StringBuilder();

		for(int i=0; i<n; i++) {
			if(i%2==0) {aa.append("0");}
			if(i%2==1) {aa.append("1");}
		}
		
	
	 String aaa = aa.toString();  
	String[]a =aaa.split("");
	 return a;
 }
 
 static String[] one(int n,String s) {
		
		StringBuilder bb = new StringBuilder();

		for(int i=0; i<n; i++) {
				if(i%2==0) {bb.append("1");}
				if(i%2==1) {bb.append("0");}
			}
		
		  String bbb = bb.toString();
		  String[]b =bbb.split("");
		 return b;
	 }
 static int ct (int n,String[]a,String[]ss) {
	 int c =0;
	 for(int i=0; i<n; i++) {
		 if(a[i].equals(ss[i])) {
		    c++;
		 }
	 }
	 
	 return c;
 }


} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
	   String s = sc.nextLine(); 
	   String[] ss = s.split("");
	  sc.close();
	int n = s.length();
	
	 int z = ct(n,zero(n,s),ss);
	int o = ct(n,one(n,s),ss);
   int ans = Math.min(z,o);
	

	
	System.out.println(ans);
	 

	}
  static String[] zero(int n,String s) {
	StringBuilder aa = new StringBuilder();

		for(int i=0; i<n; i++) {
			if(i%2==0) {aa.append("0");}
			if(i%2==1) {aa.append("1");}
		}
		
	
	 String aaa = aa.toString();  
	String[]a =aaa.split("");
	 return a;
 }
 
 static String[] one(int n,String s) {
		
		StringBuilder bb = new StringBuilder();

		for(int i=0; i<n; i++) {
				if(i%2==0) {bb.append("1");}
				if(i%2==1) {bb.append("0");}
			}
		
		  String bbb = bb.toString();
		  String[]b =bbb.split("");
		 return b;
	 }
 static int ct (int n,String[]a,String[]ss) {
	 int c =0;
	 for(int i=0; i<n; i++) {
		 if(a[i].equals(ss[i])) {
		    c++;
		 }
	 }
	 
	 return c;
 }


} Main
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
	   String s = sc.nextLine(); 
	   String[] ss = s.split("");
	  sc.close();
	int n = s.length();
	
	 int z = ct(n,zero(n,s),ss);
	int o = ct(n,one(n,s),ss);
   int ans = Math.min(z,o);
	

	
	System.out.println(ans);
	 

	}
  static String[] zero(int n,String s) {
	StringBuilder aa = new StringBuilder();

		for(int i=0; i<n; i++) {
			if(i%2==0) {aa.append("0");}
			if(i%2==1) {aa.append("1");}
		}
		
	
	 String aaa = aa.toString();  
	String[]a =aaa.split("");
	 return a;
 }
 
 static String[] one(int n,String s) {
		
		StringBuilder bb = new StringBuilder();

		for(int i=0; i<n; i++) {
				if(i%2==0) {bb.append("1");}
				if(i%2==1) {bb.append("0");}
			}
		
		  String bbb = bb.toString();
		  String[]b =bbb.split("");
		 return b;
	 }
 static int ct (int n,String[]a,String[]ss) {
	 int c =0;
	 for(int i=0; i<n; i++) {
		 if(a[i].equals(ss[i])) {
		    c++;
		 }
	 }
	 
	 return c;
 }


}