import java.util.Scanner;

public class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int ans0 = 0;
		int ans1 = 0;
		String s = sc.next();
		for(int i = 0; i < s.length(); ++i) {
			if(s.charAt(i) == '0') {
				if((i&1) == 0) ++ans1;
				else ++ans0;
			}else {
				if((i&1) == 0) ++ans0;
				else ++ans1;
			}
		}
		
		System.out.println(Math.min(ans0, ans1));
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int ans0 = 0;
		int ans1 = 0;
		String s = sc.next();
		for(int i = 0; i < s.length(); ++i) {
			if(s.charAt(i) == '0') {
				if((i&1) == 0) ++ans1;
				else ++ans0;
			}else {
				if((i&1) == 0) ++ans0;
				else ++ans1;
			}
		}
		
		System.out.println(Math.min(ans0, ans1));
	}
} Main public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int ans0 = 0;
		int ans1 = 0;
		String s = sc.next();
		for(int i = 0; i < s.length(); ++i) {
			if(s.charAt(i) == '0') {
				if((i&1) == 0) ++ans1;
				else ++ans0;
			}else {
				if((i&1) == 0) ++ans0;
				else ++ans1;
			}
		}
		
		System.out.println(Math.min(ans0, ans1));
	} main {
		Scanner sc = new Scanner(System.in);
		int ans0 = 0;
		int ans1 = 0;
		String s = sc.next();
		for(int i = 0; i < s.length(); ++i) {
			if(s.charAt(i) == '0') {
				if((i&1) == 0) ++ans1;
				else ++ans0;
			}else {
				if((i&1) == 0) ++ans0;
				else ++ans1;
			}
		}
		
		System.out.println(Math.min(ans0, ans1));
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int ans0 = 0; ans0 0 int ans1 = 0; ans1 0 String s = sc.next(); s sc.next() sc.next sc for(int i = 0; i < s.length(); ++i) {
			if(s.charAt(i) == '0') {
				if((i&1) == 0) ++ans1;
				else ++ans0;
			}else {
				if((i&1) == 0) ++ans0;
				else ++ans1;
			}
		} int i = 0; int i = 0; i 0 i < s.length() i s.length() s.length s ++i ++i i {
			if(s.charAt(i) == '0') {
				if((i&1) == 0) ++ans1;
				else ++ans0;
			}else {
				if((i&1) == 0) ++ans0;
				else ++ans1;
			}
		} {
			if(s.charAt(i) == '0') {
				if((i&1) == 0) ++ans1;
				else ++ans0;
			}else {
				if((i&1) == 0) ++ans0;
				else ++ans1;
			}
		} if(s.charAt(i) == '0') {
				if((i&1) == 0) ++ans1;
				else ++ans0;
			}else {
				if((i&1) == 0) ++ans0;
				else ++ans1;
			} s.charAt(i) == '0' s.charAt(i) s.charAt s i '0' {
				if((i&1) == 0) ++ans1;
				else ++ans0;
			} if((i&1) == 0) ++ans1;
				else ++ans0; (i&1) == 0 (i&1) i 1 0 ++ans1 ans1 ++ans0 ans0 {
				if((i&1) == 0) ++ans0;
				else ++ans1;
			} if((i&1) == 0) ++ans0;
				else ++ans1; (i&1) == 0 (i&1) i 1 0 ++ans0 ans0 ++ans1 ans1 System.out.println(Math.min(ans0, ans1)) System.out.println System.out System System.out Math.min(ans0, ans1) Math.min Math ans0 ans1 String args[] args public class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int ans0 = 0;
		int ans1 = 0;
		String s = sc.next();
		for(int i = 0; i < s.length(); ++i) {
			if(s.charAt(i) == '0') {
				if((i&1) == 0) ++ans1;
				else ++ans0;
			}else {
				if((i&1) == 0) ++ans0;
				else ++ans1;
			}
		}
		
		System.out.println(Math.min(ans0, ans1));
	}
} public class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int ans0 = 0;
		int ans1 = 0;
		String s = sc.next();
		for(int i = 0; i < s.length(); ++i) {
			if(s.charAt(i) == '0') {
				if((i&1) == 0) ++ans1;
				else ++ans0;
			}else {
				if((i&1) == 0) ++ans0;
				else ++ans1;
			}
		}
		
		System.out.println(Math.min(ans0, ans1));
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int ans0 = 0;
		int ans1 = 0;
		String s = sc.next();
		for(int i = 0; i < s.length(); ++i) {
			if(s.charAt(i) == '0') {
				if((i&1) == 0) ++ans1;
				else ++ans0;
			}else {
				if((i&1) == 0) ++ans0;
				else ++ans1;
			}
		}
		
		System.out.println(Math.min(ans0, ans1));
	}
}
