import java.util.Scanner;

public class Main {
	
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		String S = sc.next();
		
		System.out.println(getMinNumOfRepaints(S));
	}
	
	private static int getMinNumOfRepaints(String s) {
		if(s.length() <= 1) return 0;
		
		char[] arr = s.toCharArray();
		// starting from '0'
		char[] case1 = new char[arr.length];
		// starting from '1'
		char[] case2 = new char[arr.length];
		
		// fill in case1
		for(int i = 0; i < arr.length; i++) case1[i] = i % 2 == 0? '0':'1';
		// fill in case2
		for(int i = 0; i < arr.length; i++) case2[i] = i % 2 == 0? '1':'0';
		
		int count1 = 0;
		int count2 = 0;
		for(int i = 0; i < arr.length; i++){
			// for case1
			if(case1[i] != arr[i]) count1++;
			if(case2[i] != arr[i]) count2++;
		}
		
		return Math.min(count1, count2);
	}
} 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();
		
		System.out.println(getMinNumOfRepaints(S));
	}
	
	private static int getMinNumOfRepaints(String s) {
		if(s.length() <= 1) return 0;
		
		char[] arr = s.toCharArray();
		// starting from '0'
		char[] case1 = new char[arr.length];
		// starting from '1'
		char[] case2 = new char[arr.length];
		
		// fill in case1
		for(int i = 0; i < arr.length; i++) case1[i] = i % 2 == 0? '0':'1';
		// fill in case2
		for(int i = 0; i < arr.length; i++) case2[i] = i % 2 == 0? '1':'0';
		
		int count1 = 0;
		int count2 = 0;
		for(int i = 0; i < arr.length; i++){
			// for case1
			if(case1[i] != arr[i]) count1++;
			if(case2[i] != arr[i]) count2++;
		}
		
		return Math.min(count1, count2);
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		String S = sc.next();
		
		System.out.println(getMinNumOfRepaints(S));
	} main {
		Scanner sc = new Scanner(System.in);
		
		String S = sc.next();
		
		System.out.println(getMinNumOfRepaints(S));
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.next(); S sc.next() sc.next sc System.out.println(getMinNumOfRepaints(S)) System.out.println System.out System System.out getMinNumOfRepaints(S) getMinNumOfRepaints S String[] args args private static int getMinNumOfRepaints(String s) {
		if(s.length() <= 1) return 0;
		
		char[] arr = s.toCharArray();
		// starting from '0'
		char[] case1 = new char[arr.length];
		// starting from '1'
		char[] case2 = new char[arr.length];
		
		// fill in case1
		for(int i = 0; i < arr.length; i++) case1[i] = i % 2 == 0? '0':'1';
		// fill in case2
		for(int i = 0; i < arr.length; i++) case2[i] = i % 2 == 0? '1':'0';
		
		int count1 = 0;
		int count2 = 0;
		for(int i = 0; i < arr.length; i++){
			// for case1
			if(case1[i] != arr[i]) count1++;
			if(case2[i] != arr[i]) count2++;
		}
		
		return Math.min(count1, count2);
	} getMinNumOfRepaints {
		if(s.length() <= 1) return 0;
		
		char[] arr = s.toCharArray();
		// starting from '0'
		char[] case1 = new char[arr.length];
		// starting from '1'
		char[] case2 = new char[arr.length];
		
		// fill in case1
		for(int i = 0; i < arr.length; i++) case1[i] = i % 2 == 0? '0':'1';
		// fill in case2
		for(int i = 0; i < arr.length; i++) case2[i] = i % 2 == 0? '1':'0';
		
		int count1 = 0;
		int count2 = 0;
		for(int i = 0; i < arr.length; i++){
			// for case1
			if(case1[i] != arr[i]) count1++;
			if(case2[i] != arr[i]) count2++;
		}
		
		return Math.min(count1, count2);
	} if(s.length() <= 1) return 0; s.length() <= 1 s.length() s.length s 1 return 0; 0 char[] arr = s.toCharArray(); arr s.toCharArray() s.toCharArray s char[] case1 = new char[arr.length]; case1 new char[arr.length] arr.length arr arr.length char[] case2 = new char[arr.length]; case2 new char[arr.length] arr.length arr arr.length for(int i = 0; i < arr.length; i++) case1[i] = i % 2 == 0? '0':'1'; int i = 0; int i = 0; i 0 i < arr.length i arr.length arr arr.length i++ i++ i case1[i] = i % 2 == 0? '0':'1'; case1[i] = i % 2 == 0? '0':'1' case1[i] case1 i i % 2 == 0? '0':'1' i % 2 == 0 i % 2 i 2 0 '0' '1' for(int i = 0; i < arr.length; i++) case2[i] = i % 2 == 0? '1':'0'; int i = 0; int i = 0; i 0 i < arr.length i arr.length arr arr.length i++ i++ i case2[i] = i % 2 == 0? '1':'0'; case2[i] = i % 2 == 0? '1':'0' case2[i] case2 i i % 2 == 0? '1':'0' i % 2 == 0 i % 2 i 2 0 '1' '0' int count1 = 0; count1 0 int count2 = 0; count2 0 for(int i = 0; i < arr.length; i++){
			// for case1
			if(case1[i] != arr[i]) count1++;
			if(case2[i] != arr[i]) count2++;
		} int i = 0; int i = 0; i 0 i < arr.length i arr.length arr arr.length i++ i++ i {
			// for case1
			if(case1[i] != arr[i]) count1++;
			if(case2[i] != arr[i]) count2++;
		} {
			// for case1
			if(case1[i] != arr[i]) count1++;
			if(case2[i] != arr[i]) count2++;
		} if(case1[i] != arr[i]) count1++; case1[i] != arr[i] case1[i] case1 i arr[i] arr i count1++ count1 if(case2[i] != arr[i]) count2++; case2[i] != arr[i] case2[i] case2 i arr[i] arr i count2++ count2 return Math.min(count1, count2); Math.min(count1, count2) Math.min Math count1 count2 String s s public class Main {
	
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		String S = sc.next();
		
		System.out.println(getMinNumOfRepaints(S));
	}
	
	private static int getMinNumOfRepaints(String s) {
		if(s.length() <= 1) return 0;
		
		char[] arr = s.toCharArray();
		// starting from '0'
		char[] case1 = new char[arr.length];
		// starting from '1'
		char[] case2 = new char[arr.length];
		
		// fill in case1
		for(int i = 0; i < arr.length; i++) case1[i] = i % 2 == 0? '0':'1';
		// fill in case2
		for(int i = 0; i < arr.length; i++) case2[i] = i % 2 == 0? '1':'0';
		
		int count1 = 0;
		int count2 = 0;
		for(int i = 0; i < arr.length; i++){
			// for case1
			if(case1[i] != arr[i]) count1++;
			if(case2[i] != arr[i]) count2++;
		}
		
		return Math.min(count1, count2);
	}
} public class Main {
	
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		String S = sc.next();
		
		System.out.println(getMinNumOfRepaints(S));
	}
	
	private static int getMinNumOfRepaints(String s) {
		if(s.length() <= 1) return 0;
		
		char[] arr = s.toCharArray();
		// starting from '0'
		char[] case1 = new char[arr.length];
		// starting from '1'
		char[] case2 = new char[arr.length];
		
		// fill in case1
		for(int i = 0; i < arr.length; i++) case1[i] = i % 2 == 0? '0':'1';
		// fill in case2
		for(int i = 0; i < arr.length; i++) case2[i] = i % 2 == 0? '1':'0';
		
		int count1 = 0;
		int count2 = 0;
		for(int i = 0; i < arr.length; i++){
			// for case1
			if(case1[i] != arr[i]) count1++;
			if(case2[i] != arr[i]) count2++;
		}
		
		return Math.min(count1, count2);
	}
} Main
import java.util.Scanner;

public class Main {
	
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		String S = sc.next();
		
		System.out.println(getMinNumOfRepaints(S));
	}
	
	private static int getMinNumOfRepaints(String s) {
		if(s.length() <= 1) return 0;
		
		char[] arr = s.toCharArray();
		// starting from '0'
		char[] case1 = new char[arr.length];
		// starting from '1'
		char[] case2 = new char[arr.length];
		
		// fill in case1
		for(int i = 0; i < arr.length; i++) case1[i] = i % 2 == 0? '0':'1';
		// fill in case2
		for(int i = 0; i < arr.length; i++) case2[i] = i % 2 == 0? '1':'0';
		
		int count1 = 0;
		int count2 = 0;
		for(int i = 0; i < arr.length; i++){
			// for case1
			if(case1[i] != arr[i]) count1++;
			if(case2[i] != arr[i]) count2++;
		}
		
		return Math.min(count1, count2);
	}
}
