import java.util.*;
class Main{
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		String s=sc.next();
		char[] c=s.toCharArray();
		int count1=0;
		int count2=0;
		for(int i=0;i<c.length;i++){
			if((i%2==0&&c[i]=='0')||(i%2!=0&&c[i]=='1'))
				count1++;
			if((i%2==0&&c[i]=='1')||(i%2!=0&&c[i]=='0'))
				count2++;
		}
		System.out.println(count1<count2?count1:count2);		
	}
	
} import java.util.*; util.* java class Main{
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		String s=sc.next();
		char[] c=s.toCharArray();
		int count1=0;
		int count2=0;
		for(int i=0;i<c.length;i++){
			if((i%2==0&&c[i]=='0')||(i%2!=0&&c[i]=='1'))
				count1++;
			if((i%2==0&&c[i]=='1')||(i%2!=0&&c[i]=='0'))
				count2++;
		}
		System.out.println(count1<count2?count1:count2);		
	}
	
} Main public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		String s=sc.next();
		char[] c=s.toCharArray();
		int count1=0;
		int count2=0;
		for(int i=0;i<c.length;i++){
			if((i%2==0&&c[i]=='0')||(i%2!=0&&c[i]=='1'))
				count1++;
			if((i%2==0&&c[i]=='1')||(i%2!=0&&c[i]=='0'))
				count2++;
		}
		System.out.println(count1<count2?count1:count2);		
	} main {
		Scanner sc=new Scanner(System.in);
		String s=sc.next();
		char[] c=s.toCharArray();
		int count1=0;
		int count2=0;
		for(int i=0;i<c.length;i++){
			if((i%2==0&&c[i]=='0')||(i%2!=0&&c[i]=='1'))
				count1++;
			if((i%2==0&&c[i]=='1')||(i%2!=0&&c[i]=='0'))
				count2++;
		}
		System.out.println(count1<count2?count1:count2);		
	} Scanner sc=new Scanner(System.in); sc new Scanner(System.in) String s=sc.next(); s sc.next() sc.next sc char[] c=s.toCharArray(); c s.toCharArray() s.toCharArray s int count1=0; count1 0 int count2=0; count2 0 for(int i=0;i<c.length;i++){
			if((i%2==0&&c[i]=='0')||(i%2!=0&&c[i]=='1'))
				count1++;
			if((i%2==0&&c[i]=='1')||(i%2!=0&&c[i]=='0'))
				count2++;
		} int i=0; int i=0; i 0 i<c.length i c.length c c.length i++ i++ i {
			if((i%2==0&&c[i]=='0')||(i%2!=0&&c[i]=='1'))
				count1++;
			if((i%2==0&&c[i]=='1')||(i%2!=0&&c[i]=='0'))
				count2++;
		} {
			if((i%2==0&&c[i]=='0')||(i%2!=0&&c[i]=='1'))
				count1++;
			if((i%2==0&&c[i]=='1')||(i%2!=0&&c[i]=='0'))
				count2++;
		} if((i%2==0&&c[i]=='0')||(i%2!=0&&c[i]=='1'))
				count1++; (i%2==0&&c[i]=='0')||(i%2!=0&&c[i]=='1') (i%2==0&&c[i]=='0') i%2==0 i%2 i 2 0 c[i]=='0' c[i] c i '0' (i%2!=0&&c[i]=='1') i%2!=0 i%2 i 2 0 c[i]=='1' c[i] c i '1' count1++ count1 if((i%2==0&&c[i]=='1')||(i%2!=0&&c[i]=='0'))
				count2++; (i%2==0&&c[i]=='1')||(i%2!=0&&c[i]=='0') (i%2==0&&c[i]=='1') i%2==0 i%2 i 2 0 c[i]=='1' c[i] c i '1' (i%2!=0&&c[i]=='0') i%2!=0 i%2 i 2 0 c[i]=='0' c[i] c i '0' count2++ count2 System.out.println(count1<count2?count1:count2) System.out.println System.out System System.out count1<count2?count1:count2 count1<count2 count1 count2 count1 count2 String[] args args
import java.util.*;
class Main{
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		String s=sc.next();
		char[] c=s.toCharArray();
		int count1=0;
		int count2=0;
		for(int i=0;i<c.length;i++){
			if((i%2==0&&c[i]=='0')||(i%2!=0&&c[i]=='1'))
				count1++;
			if((i%2==0&&c[i]=='1')||(i%2!=0&&c[i]=='0'))
				count2++;
		}
		System.out.println(count1<count2?count1:count2);		
	}
	
}