import java.util.Arrays;
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		String S = sc.next();
		int N = S.length();
		char[] C = S.toCharArray();
		char A0 = '0';
		char A1 = '1';
		int count0 =0;
		int count1 = 0;
		for(int i=0; i<N; i++) {
			if( C[i]!=A0){
				count0++;            	
            }
			if(A0=='0') {
				A0 ='1';
			}else {
				A0 ='0';
			}
			if( C[i]!=A1){
				count1++;            	
            }
			if(A1=='0') {
				A1 ='1';
			}else {
				A1='0';
			}
		}
		System.out.println(Math.min(count0,count1));
	}		
} import java.util.Arrays; Arrays java.util 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.next();
		int N = S.length();
		char[] C = S.toCharArray();
		char A0 = '0';
		char A1 = '1';
		int count0 =0;
		int count1 = 0;
		for(int i=0; i<N; i++) {
			if( C[i]!=A0){
				count0++;            	
            }
			if(A0=='0') {
				A0 ='1';
			}else {
				A0 ='0';
			}
			if( C[i]!=A1){
				count1++;            	
            }
			if(A1=='0') {
				A1 ='1';
			}else {
				A1='0';
			}
		}
		System.out.println(Math.min(count0,count1));
	}		
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		String S = sc.next();
		int N = S.length();
		char[] C = S.toCharArray();
		char A0 = '0';
		char A1 = '1';
		int count0 =0;
		int count1 = 0;
		for(int i=0; i<N; i++) {
			if( C[i]!=A0){
				count0++;            	
            }
			if(A0=='0') {
				A0 ='1';
			}else {
				A0 ='0';
			}
			if( C[i]!=A1){
				count1++;            	
            }
			if(A1=='0') {
				A1 ='1';
			}else {
				A1='0';
			}
		}
		System.out.println(Math.min(count0,count1));
	} main {
		Scanner sc = new Scanner(System.in);
		
		String S = sc.next();
		int N = S.length();
		char[] C = S.toCharArray();
		char A0 = '0';
		char A1 = '1';
		int count0 =0;
		int count1 = 0;
		for(int i=0; i<N; i++) {
			if( C[i]!=A0){
				count0++;            	
            }
			if(A0=='0') {
				A0 ='1';
			}else {
				A0 ='0';
			}
			if( C[i]!=A1){
				count1++;            	
            }
			if(A1=='0') {
				A1 ='1';
			}else {
				A1='0';
			}
		}
		System.out.println(Math.min(count0,count1));
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.next(); S sc.next() sc.next sc int N = S.length(); N S.length() S.length S char[] C = S.toCharArray(); C S.toCharArray() S.toCharArray S char A0 = '0'; A0 '0' char A1 = '1'; A1 '1' int count0 =0; count0 0 int count1 = 0; count1 0 for(int i=0; i<N; i++) {
			if( C[i]!=A0){
				count0++;            	
            }
			if(A0=='0') {
				A0 ='1';
			}else {
				A0 ='0';
			}
			if( C[i]!=A1){
				count1++;            	
            }
			if(A1=='0') {
				A1 ='1';
			}else {
				A1='0';
			}
		} int i=0; int i=0; i 0 i<N i N i++ i++ i {
			if( C[i]!=A0){
				count0++;            	
            }
			if(A0=='0') {
				A0 ='1';
			}else {
				A0 ='0';
			}
			if( C[i]!=A1){
				count1++;            	
            }
			if(A1=='0') {
				A1 ='1';
			}else {
				A1='0';
			}
		} {
			if( C[i]!=A0){
				count0++;            	
            }
			if(A0=='0') {
				A0 ='1';
			}else {
				A0 ='0';
			}
			if( C[i]!=A1){
				count1++;            	
            }
			if(A1=='0') {
				A1 ='1';
			}else {
				A1='0';
			}
		} if( C[i]!=A0){
				count0++;            	
            } C[i]!=A0 C[i] C i A0 {
				count0++;            	
            } count0++ count0 if(A0=='0') {
				A0 ='1';
			}else {
				A0 ='0';
			} A0=='0' A0 '0' {
				A0 ='1';
			} A0 ='1' A0 '1' {
				A0 ='0';
			} A0 ='0' A0 '0' if( C[i]!=A1){
				count1++;            	
            } C[i]!=A1 C[i] C i A1 {
				count1++;            	
            } count1++ count1 if(A1=='0') {
				A1 ='1';
			}else {
				A1='0';
			} A1=='0' A1 '0' {
				A1 ='1';
			} A1 ='1' A1 '1' {
				A1='0';
			} A1='0' A1 '0' System.out.println(Math.min(count0,count1)) System.out.println System.out System System.out Math.min(count0,count1) Math.min Math count0 count1 String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		String S = sc.next();
		int N = S.length();
		char[] C = S.toCharArray();
		char A0 = '0';
		char A1 = '1';
		int count0 =0;
		int count1 = 0;
		for(int i=0; i<N; i++) {
			if( C[i]!=A0){
				count0++;            	
            }
			if(A0=='0') {
				A0 ='1';
			}else {
				A0 ='0';
			}
			if( C[i]!=A1){
				count1++;            	
            }
			if(A1=='0') {
				A1 ='1';
			}else {
				A1='0';
			}
		}
		System.out.println(Math.min(count0,count1));
	}		
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		String S = sc.next();
		int N = S.length();
		char[] C = S.toCharArray();
		char A0 = '0';
		char A1 = '1';
		int count0 =0;
		int count1 = 0;
		for(int i=0; i<N; i++) {
			if( C[i]!=A0){
				count0++;            	
            }
			if(A0=='0') {
				A0 ='1';
			}else {
				A0 ='0';
			}
			if( C[i]!=A1){
				count1++;            	
            }
			if(A1=='0') {
				A1 ='1';
			}else {
				A1='0';
			}
		}
		System.out.println(Math.min(count0,count1));
	}		
} Main
import java.util.Arrays;
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		String S = sc.next();
		int N = S.length();
		char[] C = S.toCharArray();
		char A0 = '0';
		char A1 = '1';
		int count0 =0;
		int count1 = 0;
		for(int i=0; i<N; i++) {
			if( C[i]!=A0){
				count0++;            	
            }
			if(A0=='0') {
				A0 ='1';
			}else {
				A0 ='0';
			}
			if( C[i]!=A1){
				count1++;            	
            }
			if(A1=='0') {
				A1 ='1';
			}else {
				A1='0';
			}
		}
		System.out.println(Math.min(count0,count1));
	}		
}