import java.util.Scanner;
public class Main{
 public static void main(String[] args){
   Scanner sc = new Scanner(System.in);
   char[] c = sc.next().toCharArray();
 
   char[] each1 = new char[c.length];
   char[] each2 = new char[c.length];
   for(int i = 0; i<c.length;i+=2)
   {
	 each1[i] = '0';
     each2[i] = '1';  
   }
   for(int i = 1; i<c.length;i+=2)
   {
	 each1[i] = '1';
     each2[i] = '0';  
   }
   
   int ans1 =0;
   int ans2 =0;
   for(int i=0;i<c.length;i++)
   {
     if(each1[i]!=c[i]) ans1++;
     if(each2[i]!=c[i]) ans2++;
   }
 
   if(ans1>ans2) System.out.println(ans2);
   else System.out.println(ans1);
 }
} import java.util.Scanner; Scanner java.util public class Main{
 public static void main(String[] args){
   Scanner sc = new Scanner(System.in);
   char[] c = sc.next().toCharArray();
 
   char[] each1 = new char[c.length];
   char[] each2 = new char[c.length];
   for(int i = 0; i<c.length;i+=2)
   {
	 each1[i] = '0';
     each2[i] = '1';  
   }
   for(int i = 1; i<c.length;i+=2)
   {
	 each1[i] = '1';
     each2[i] = '0';  
   }
   
   int ans1 =0;
   int ans2 =0;
   for(int i=0;i<c.length;i++)
   {
     if(each1[i]!=c[i]) ans1++;
     if(each2[i]!=c[i]) ans2++;
   }
 
   if(ans1>ans2) System.out.println(ans2);
   else System.out.println(ans1);
 }
} Main public static void main(String[] args){
   Scanner sc = new Scanner(System.in);
   char[] c = sc.next().toCharArray();
 
   char[] each1 = new char[c.length];
   char[] each2 = new char[c.length];
   for(int i = 0; i<c.length;i+=2)
   {
	 each1[i] = '0';
     each2[i] = '1';  
   }
   for(int i = 1; i<c.length;i+=2)
   {
	 each1[i] = '1';
     each2[i] = '0';  
   }
   
   int ans1 =0;
   int ans2 =0;
   for(int i=0;i<c.length;i++)
   {
     if(each1[i]!=c[i]) ans1++;
     if(each2[i]!=c[i]) ans2++;
   }
 
   if(ans1>ans2) System.out.println(ans2);
   else System.out.println(ans1);
 } main {
   Scanner sc = new Scanner(System.in);
   char[] c = sc.next().toCharArray();
 
   char[] each1 = new char[c.length];
   char[] each2 = new char[c.length];
   for(int i = 0; i<c.length;i+=2)
   {
	 each1[i] = '0';
     each2[i] = '1';  
   }
   for(int i = 1; i<c.length;i+=2)
   {
	 each1[i] = '1';
     each2[i] = '0';  
   }
   
   int ans1 =0;
   int ans2 =0;
   for(int i=0;i<c.length;i++)
   {
     if(each1[i]!=c[i]) ans1++;
     if(each2[i]!=c[i]) ans2++;
   }
 
   if(ans1>ans2) System.out.println(ans2);
   else System.out.println(ans1);
 } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) char[] c = sc.next().toCharArray(); c sc.next().toCharArray() sc.next().toCharArray sc.next() sc.next sc char[] each1 = new char[c.length]; each1 new char[c.length] c.length c c.length char[] each2 = new char[c.length]; each2 new char[c.length] c.length c c.length for(int i = 0; i<c.length;i+=2)
   {
	 each1[i] = '0';
     each2[i] = '1';  
   } int i = 0; int i = 0; i 0 i<c.length i c.length c c.length i+=2 i+=2 i 2 {
	 each1[i] = '0';
     each2[i] = '1';  
   } {
	 each1[i] = '0';
     each2[i] = '1';  
   } each1[i] = '0' each1[i] each1 i '0' each2[i] = '1' each2[i] each2 i '1' for(int i = 1; i<c.length;i+=2)
   {
	 each1[i] = '1';
     each2[i] = '0';  
   } int i = 1; int i = 1; i 1 i<c.length i c.length c c.length i+=2 i+=2 i 2 {
	 each1[i] = '1';
     each2[i] = '0';  
   } {
	 each1[i] = '1';
     each2[i] = '0';  
   } each1[i] = '1' each1[i] each1 i '1' each2[i] = '0' each2[i] each2 i '0' int ans1 =0; ans1 0 int ans2 =0; ans2 0 for(int i=0;i<c.length;i++)
   {
     if(each1[i]!=c[i]) ans1++;
     if(each2[i]!=c[i]) ans2++;
   } int i=0; int i=0; i 0 i<c.length i c.length c c.length i++ i++ i {
     if(each1[i]!=c[i]) ans1++;
     if(each2[i]!=c[i]) ans2++;
   } {
     if(each1[i]!=c[i]) ans1++;
     if(each2[i]!=c[i]) ans2++;
   } if(each1[i]!=c[i]) ans1++; each1[i]!=c[i] each1[i] each1 i c[i] c i ans1++ ans1 if(each2[i]!=c[i]) ans2++; each2[i]!=c[i] each2[i] each2 i c[i] c i ans2++ ans2 if(ans1>ans2) System.out.println(ans2);
   else System.out.println(ans1); ans1>ans2 ans1 ans2 System.out.println(ans2) System.out.println System.out System System.out ans2 System.out.println(ans1) System.out.println System.out System System.out ans1 String[] args args public class Main{
 public static void main(String[] args){
   Scanner sc = new Scanner(System.in);
   char[] c = sc.next().toCharArray();
 
   char[] each1 = new char[c.length];
   char[] each2 = new char[c.length];
   for(int i = 0; i<c.length;i+=2)
   {
	 each1[i] = '0';
     each2[i] = '1';  
   }
   for(int i = 1; i<c.length;i+=2)
   {
	 each1[i] = '1';
     each2[i] = '0';  
   }
   
   int ans1 =0;
   int ans2 =0;
   for(int i=0;i<c.length;i++)
   {
     if(each1[i]!=c[i]) ans1++;
     if(each2[i]!=c[i]) ans2++;
   }
 
   if(ans1>ans2) System.out.println(ans2);
   else System.out.println(ans1);
 }
} public class Main{
 public static void main(String[] args){
   Scanner sc = new Scanner(System.in);
   char[] c = sc.next().toCharArray();
 
   char[] each1 = new char[c.length];
   char[] each2 = new char[c.length];
   for(int i = 0; i<c.length;i+=2)
   {
	 each1[i] = '0';
     each2[i] = '1';  
   }
   for(int i = 1; i<c.length;i+=2)
   {
	 each1[i] = '1';
     each2[i] = '0';  
   }
   
   int ans1 =0;
   int ans2 =0;
   for(int i=0;i<c.length;i++)
   {
     if(each1[i]!=c[i]) ans1++;
     if(each2[i]!=c[i]) ans2++;
   }
 
   if(ans1>ans2) System.out.println(ans2);
   else System.out.println(ans1);
 }
} Main
import java.util.Scanner;
public class Main{
 public static void main(String[] args){
   Scanner sc = new Scanner(System.in);
   char[] c = sc.next().toCharArray();
 
   char[] each1 = new char[c.length];
   char[] each2 = new char[c.length];
   for(int i = 0; i<c.length;i+=2)
   {
	 each1[i] = '0';
     each2[i] = '1';  
   }
   for(int i = 1; i<c.length;i+=2)
   {
	 each1[i] = '1';
     each2[i] = '0';  
   }
   
   int ans1 =0;
   int ans2 =0;
   for(int i=0;i<c.length;i++)
   {
     if(each1[i]!=c[i]) ans1++;
     if(each2[i]!=c[i]) ans2++;
   }
 
   if(ans1>ans2) System.out.println(ans2);
   else System.out.println(ans1);
 }
}