import java.util.Scanner;
 
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String input = sc.nextLine();
		int countA = 0;
		int countB = 0;
		int A =0;
		int B =1;
		for (int i = 0; i < input.length() ; i++) {
			int tmp = combertInt(input,i);
			if(A == tmp) {
            	countA++;
            }
          	if(A==0) {
				A=1;
			}else{
				A=0;
			}
          	if(B == tmp) {
            	countB++;
            }
			if(B==1) {
				B=0;
			}else{
				B=1;
			}
		}
		System.out.println(Math.min(countA, countB));
	}
	
	private static Integer combertInt(String s, int i) {
		return Integer.parseInt(s.substring(i,i+1));
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String input = sc.nextLine();
		int countA = 0;
		int countB = 0;
		int A =0;
		int B =1;
		for (int i = 0; i < input.length() ; i++) {
			int tmp = combertInt(input,i);
			if(A == tmp) {
            	countA++;
            }
          	if(A==0) {
				A=1;
			}else{
				A=0;
			}
          	if(B == tmp) {
            	countB++;
            }
			if(B==1) {
				B=0;
			}else{
				B=1;
			}
		}
		System.out.println(Math.min(countA, countB));
	}
	
	private static Integer combertInt(String s, int i) {
		return Integer.parseInt(s.substring(i,i+1));
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String input = sc.nextLine();
		int countA = 0;
		int countB = 0;
		int A =0;
		int B =1;
		for (int i = 0; i < input.length() ; i++) {
			int tmp = combertInt(input,i);
			if(A == tmp) {
            	countA++;
            }
          	if(A==0) {
				A=1;
			}else{
				A=0;
			}
          	if(B == tmp) {
            	countB++;
            }
			if(B==1) {
				B=0;
			}else{
				B=1;
			}
		}
		System.out.println(Math.min(countA, countB));
	} main {
		Scanner sc = new Scanner(System.in);
		String input = sc.nextLine();
		int countA = 0;
		int countB = 0;
		int A =0;
		int B =1;
		for (int i = 0; i < input.length() ; i++) {
			int tmp = combertInt(input,i);
			if(A == tmp) {
            	countA++;
            }
          	if(A==0) {
				A=1;
			}else{
				A=0;
			}
          	if(B == tmp) {
            	countB++;
            }
			if(B==1) {
				B=0;
			}else{
				B=1;
			}
		}
		System.out.println(Math.min(countA, countB));
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String input = sc.nextLine(); input sc.nextLine() sc.nextLine sc int countA = 0; countA 0 int countB = 0; countB 0 int A =0; A 0 int B =1; B 1 for (int i = 0; i < input.length() ; i++) {
			int tmp = combertInt(input,i);
			if(A == tmp) {
            	countA++;
            }
          	if(A==0) {
				A=1;
			}else{
				A=0;
			}
          	if(B == tmp) {
            	countB++;
            }
			if(B==1) {
				B=0;
			}else{
				B=1;
			}
		} int i = 0; int i = 0; i 0 i < input.length() i input.length() input.length input i++ i++ i {
			int tmp = combertInt(input,i);
			if(A == tmp) {
            	countA++;
            }
          	if(A==0) {
				A=1;
			}else{
				A=0;
			}
          	if(B == tmp) {
            	countB++;
            }
			if(B==1) {
				B=0;
			}else{
				B=1;
			}
		} {
			int tmp = combertInt(input,i);
			if(A == tmp) {
            	countA++;
            }
          	if(A==0) {
				A=1;
			}else{
				A=0;
			}
          	if(B == tmp) {
            	countB++;
            }
			if(B==1) {
				B=0;
			}else{
				B=1;
			}
		} int tmp = combertInt(input,i); tmp combertInt(input,i) combertInt input i if(A == tmp) {
            	countA++;
            } A == tmp A tmp {
            	countA++;
            } countA++ countA if(A==0) {
				A=1;
			}else{
				A=0;
			} A==0 A 0 {
				A=1;
			} A=1 A 1 {
				A=0;
			} A=0 A 0 if(B == tmp) {
            	countB++;
            } B == tmp B tmp {
            	countB++;
            } countB++ countB if(B==1) {
				B=0;
			}else{
				B=1;
			} B==1 B 1 {
				B=0;
			} B=0 B 0 {
				B=1;
			} B=1 B 1 System.out.println(Math.min(countA, countB)) System.out.println System.out System System.out Math.min(countA, countB) Math.min Math countA countB String[] args args private static Integer combertInt(String s, int i) {
		return Integer.parseInt(s.substring(i,i+1));
	} combertInt {
		return Integer.parseInt(s.substring(i,i+1));
	} return Integer.parseInt(s.substring(i,i+1)); Integer.parseInt(s.substring(i,i+1)) Integer.parseInt Integer s.substring(i,i+1) s.substring s i i+1 i 1 String s s int i i public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String input = sc.nextLine();
		int countA = 0;
		int countB = 0;
		int A =0;
		int B =1;
		for (int i = 0; i < input.length() ; i++) {
			int tmp = combertInt(input,i);
			if(A == tmp) {
            	countA++;
            }
          	if(A==0) {
				A=1;
			}else{
				A=0;
			}
          	if(B == tmp) {
            	countB++;
            }
			if(B==1) {
				B=0;
			}else{
				B=1;
			}
		}
		System.out.println(Math.min(countA, countB));
	}
	
	private static Integer combertInt(String s, int i) {
		return Integer.parseInt(s.substring(i,i+1));
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String input = sc.nextLine();
		int countA = 0;
		int countB = 0;
		int A =0;
		int B =1;
		for (int i = 0; i < input.length() ; i++) {
			int tmp = combertInt(input,i);
			if(A == tmp) {
            	countA++;
            }
          	if(A==0) {
				A=1;
			}else{
				A=0;
			}
          	if(B == tmp) {
            	countB++;
            }
			if(B==1) {
				B=0;
			}else{
				B=1;
			}
		}
		System.out.println(Math.min(countA, countB));
	}
	
	private static Integer combertInt(String s, int i) {
		return Integer.parseInt(s.substring(i,i+1));
	}
} Main
import java.util.Scanner;
 
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String input = sc.nextLine();
		int countA = 0;
		int countB = 0;
		int A =0;
		int B =1;
		for (int i = 0; i < input.length() ; i++) {
			int tmp = combertInt(input,i);
			if(A == tmp) {
            	countA++;
            }
          	if(A==0) {
				A=1;
			}else{
				A=0;
			}
          	if(B == tmp) {
            	countB++;
            }
			if(B==1) {
				B=0;
			}else{
				B=1;
			}
		}
		System.out.println(Math.min(countA, countB));
	}
	
	private static Integer combertInt(String s, int i) {
		return Integer.parseInt(s.substring(i,i+1));
	}
}