import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int ans0 = 0;
		int ans1 = 0;
		for (int i = 0; i < s.length(); i++) {
			int target = s.charAt(i)-'0';
			if (i % 2 == 0) {
				if (0 == target) {ans0++;}
				if (1 == target) {ans1++;}
			}else {
				if (0 ==  target) {ans1++;}
				if (1 ==  target) {ans0++;}
			}
		}
		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);
		String s = sc.next();
		int ans0 = 0;
		int ans1 = 0;
		for (int i = 0; i < s.length(); i++) {
			int target = s.charAt(i)-'0';
			if (i % 2 == 0) {
				if (0 == target) {ans0++;}
				if (1 == target) {ans1++;}
			}else {
				if (0 ==  target) {ans1++;}
				if (1 ==  target) {ans0++;}
			}
		}
		System.out.println(Math.min(ans0, ans1));
	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int ans0 = 0;
		int ans1 = 0;
		for (int i = 0; i < s.length(); i++) {
			int target = s.charAt(i)-'0';
			if (i % 2 == 0) {
				if (0 == target) {ans0++;}
				if (1 == target) {ans1++;}
			}else {
				if (0 ==  target) {ans1++;}
				if (1 ==  target) {ans0++;}
			}
		}
		System.out.println(Math.min(ans0, ans1));
	} main {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int ans0 = 0;
		int ans1 = 0;
		for (int i = 0; i < s.length(); i++) {
			int target = s.charAt(i)-'0';
			if (i % 2 == 0) {
				if (0 == target) {ans0++;}
				if (1 == target) {ans1++;}
			}else {
				if (0 ==  target) {ans1++;}
				if (1 ==  target) {ans0++;}
			}
		}
		System.out.println(Math.min(ans0, ans1));
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc int ans0 = 0; ans0 0 int ans1 = 0; ans1 0 for (int i = 0; i < s.length(); i++) {
			int target = s.charAt(i)-'0';
			if (i % 2 == 0) {
				if (0 == target) {ans0++;}
				if (1 == target) {ans1++;}
			}else {
				if (0 ==  target) {ans1++;}
				if (1 ==  target) {ans0++;}
			}
		} int i = 0; int i = 0; i 0 i < s.length() i s.length() s.length s i++ i++ i {
			int target = s.charAt(i)-'0';
			if (i % 2 == 0) {
				if (0 == target) {ans0++;}
				if (1 == target) {ans1++;}
			}else {
				if (0 ==  target) {ans1++;}
				if (1 ==  target) {ans0++;}
			}
		} {
			int target = s.charAt(i)-'0';
			if (i % 2 == 0) {
				if (0 == target) {ans0++;}
				if (1 == target) {ans1++;}
			}else {
				if (0 ==  target) {ans1++;}
				if (1 ==  target) {ans0++;}
			}
		} int target = s.charAt(i)-'0'; target s.charAt(i)-'0' s.charAt(i) s.charAt s i '0' if (i % 2 == 0) {
				if (0 == target) {ans0++;}
				if (1 == target) {ans1++;}
			}else {
				if (0 ==  target) {ans1++;}
				if (1 ==  target) {ans0++;}
			} i % 2 == 0 i % 2 i 2 0 {
				if (0 == target) {ans0++;}
				if (1 == target) {ans1++;}
			} if (0 == target) {ans0++;} 0 == target 0 target {ans0++;} ans0++ ans0 if (1 == target) {ans1++;} 1 == target 1 target {ans1++;} ans1++ ans1 {
				if (0 ==  target) {ans1++;}
				if (1 ==  target) {ans0++;}
			} if (0 ==  target) {ans1++;} 0 ==  target 0 target {ans1++;} ans1++ ans1 if (1 ==  target) {ans0++;} 1 ==  target 1 target {ans0++;} ans0++ ans0 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);
		String s = sc.next();
		int ans0 = 0;
		int ans1 = 0;
		for (int i = 0; i < s.length(); i++) {
			int target = s.charAt(i)-'0';
			if (i % 2 == 0) {
				if (0 == target) {ans0++;}
				if (1 == target) {ans1++;}
			}else {
				if (0 ==  target) {ans1++;}
				if (1 ==  target) {ans0++;}
			}
		}
		System.out.println(Math.min(ans0, ans1));
	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int ans0 = 0;
		int ans1 = 0;
		for (int i = 0; i < s.length(); i++) {
			int target = s.charAt(i)-'0';
			if (i % 2 == 0) {
				if (0 == target) {ans0++;}
				if (1 == target) {ans1++;}
			}else {
				if (0 ==  target) {ans1++;}
				if (1 ==  target) {ans0++;}
			}
		}
		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);
		String s = sc.next();
		int ans0 = 0;
		int ans1 = 0;
		for (int i = 0; i < s.length(); i++) {
			int target = s.charAt(i)-'0';
			if (i % 2 == 0) {
				if (0 == target) {ans0++;}
				if (1 == target) {ans1++;}
			}else {
				if (0 ==  target) {ans1++;}
				if (1 ==  target) {ans0++;}
			}
		}
		System.out.println(Math.min(ans0, ans1));
	}

}


