import java.util.Scanner;

class Main {
	public static void main(String[] $) {
		Scanner sc = new Scanner(System.in);
		String s=sc.next(),t;
		int countOdd=0,countEven=0;
		for(int i=0;i<s.length();i++) {
			if(i%2==0)t="0";
			else t="1";
			if(!s.substring(i, i+1).equals(t))countOdd++;
		}
		for(int i=0;i<s.length();i++) {
			if(i%2==0)t="1";
			else t="0";
			if(!s.substring(i, i+1).equals(t))countEven++;
		}
		System.out.println((int)Math.min(countOdd,countEven));
	}
}
 import java.util.Scanner; Scanner java.util class Main {
	public static void main(String[] $) {
		Scanner sc = new Scanner(System.in);
		String s=sc.next(),t;
		int countOdd=0,countEven=0;
		for(int i=0;i<s.length();i++) {
			if(i%2==0)t="0";
			else t="1";
			if(!s.substring(i, i+1).equals(t))countOdd++;
		}
		for(int i=0;i<s.length();i++) {
			if(i%2==0)t="1";
			else t="0";
			if(!s.substring(i, i+1).equals(t))countEven++;
		}
		System.out.println((int)Math.min(countOdd,countEven));
	}
} Main public static void main(String[] $) {
		Scanner sc = new Scanner(System.in);
		String s=sc.next(),t;
		int countOdd=0,countEven=0;
		for(int i=0;i<s.length();i++) {
			if(i%2==0)t="0";
			else t="1";
			if(!s.substring(i, i+1).equals(t))countOdd++;
		}
		for(int i=0;i<s.length();i++) {
			if(i%2==0)t="1";
			else t="0";
			if(!s.substring(i, i+1).equals(t))countEven++;
		}
		System.out.println((int)Math.min(countOdd,countEven));
	} main {
		Scanner sc = new Scanner(System.in);
		String s=sc.next(),t;
		int countOdd=0,countEven=0;
		for(int i=0;i<s.length();i++) {
			if(i%2==0)t="0";
			else t="1";
			if(!s.substring(i, i+1).equals(t))countOdd++;
		}
		for(int i=0;i<s.length();i++) {
			if(i%2==0)t="1";
			else t="0";
			if(!s.substring(i, i+1).equals(t))countEven++;
		}
		System.out.println((int)Math.min(countOdd,countEven));
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s=sc.next() s sc.next() sc.next sc t; t int countOdd=0 countOdd 0 countEven=0; countEven 0 for(int i=0;i<s.length();i++) {
			if(i%2==0)t="0";
			else t="1";
			if(!s.substring(i, i+1).equals(t))countOdd++;
		} int i=0; int i=0; i 0 i<s.length() i s.length() s.length s i++ i++ i {
			if(i%2==0)t="0";
			else t="1";
			if(!s.substring(i, i+1).equals(t))countOdd++;
		} {
			if(i%2==0)t="0";
			else t="1";
			if(!s.substring(i, i+1).equals(t))countOdd++;
		} if(i%2==0)t="0";
			else t="1"; i%2==0 i%2 i 2 0 t="0" t "0" t="1" t "1" if(!s.substring(i, i+1).equals(t))countOdd++; !s.substring(i, i+1).equals(t) s.substring(i, i+1).equals(t) s.substring(i, i+1).equals s.substring(i, i+1) s.substring s i i+1 i 1 t countOdd++ countOdd for(int i=0;i<s.length();i++) {
			if(i%2==0)t="1";
			else t="0";
			if(!s.substring(i, i+1).equals(t))countEven++;
		} int i=0; int i=0; i 0 i<s.length() i s.length() s.length s i++ i++ i {
			if(i%2==0)t="1";
			else t="0";
			if(!s.substring(i, i+1).equals(t))countEven++;
		} {
			if(i%2==0)t="1";
			else t="0";
			if(!s.substring(i, i+1).equals(t))countEven++;
		} if(i%2==0)t="1";
			else t="0"; i%2==0 i%2 i 2 0 t="1" t "1" t="0" t "0" if(!s.substring(i, i+1).equals(t))countEven++; !s.substring(i, i+1).equals(t) s.substring(i, i+1).equals(t) s.substring(i, i+1).equals s.substring(i, i+1) s.substring s i i+1 i 1 t countEven++ countEven System.out.println((int)Math.min(countOdd,countEven)) System.out.println System.out System System.out (int)Math.min(countOdd,countEven) Math.min Math countOdd countEven String[] $ $
import java.util.Scanner;

class Main {
	public static void main(String[] $) {
		Scanner sc = new Scanner(System.in);
		String s=sc.next(),t;
		int countOdd=0,countEven=0;
		for(int i=0;i<s.length();i++) {
			if(i%2==0)t="0";
			else t="1";
			if(!s.substring(i, i+1).equals(t))countOdd++;
		}
		for(int i=0;i<s.length();i++) {
			if(i%2==0)t="1";
			else t="0";
			if(!s.substring(i, i+1).equals(t))countEven++;
		}
		System.out.println((int)Math.min(countOdd,countEven));
	}
}

