import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner reader = new Scanner(System.in);
		String str = reader.next();
		int ans1 = 0;
		int ans2 = 0;
		for (int i = 0; i < str.length(); i++) {
			char ch = str.charAt(i);
			if (Character.getNumericValue(ch) != i%2) {
				ans1++;
			}
			if (Character.getNumericValue(ch) != (i+1)%2) {
				ans2++;
			}
		}


		System.out.println(Math.min(ans1, ans2));
		reader.close();

	}

}


 import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner reader = new Scanner(System.in);
		String str = reader.next();
		int ans1 = 0;
		int ans2 = 0;
		for (int i = 0; i < str.length(); i++) {
			char ch = str.charAt(i);
			if (Character.getNumericValue(ch) != i%2) {
				ans1++;
			}
			if (Character.getNumericValue(ch) != (i+1)%2) {
				ans2++;
			}
		}


		System.out.println(Math.min(ans1, ans2));
		reader.close();

	}

} Main public static void main(String[] args) {
		Scanner reader = new Scanner(System.in);
		String str = reader.next();
		int ans1 = 0;
		int ans2 = 0;
		for (int i = 0; i < str.length(); i++) {
			char ch = str.charAt(i);
			if (Character.getNumericValue(ch) != i%2) {
				ans1++;
			}
			if (Character.getNumericValue(ch) != (i+1)%2) {
				ans2++;
			}
		}


		System.out.println(Math.min(ans1, ans2));
		reader.close();

	} main {
		Scanner reader = new Scanner(System.in);
		String str = reader.next();
		int ans1 = 0;
		int ans2 = 0;
		for (int i = 0; i < str.length(); i++) {
			char ch = str.charAt(i);
			if (Character.getNumericValue(ch) != i%2) {
				ans1++;
			}
			if (Character.getNumericValue(ch) != (i+1)%2) {
				ans2++;
			}
		}


		System.out.println(Math.min(ans1, ans2));
		reader.close();

	} Scanner reader = new Scanner(System.in); reader new Scanner(System.in) String str = reader.next(); str reader.next() reader.next reader int ans1 = 0; ans1 0 int ans2 = 0; ans2 0 for (int i = 0; i < str.length(); i++) {
			char ch = str.charAt(i);
			if (Character.getNumericValue(ch) != i%2) {
				ans1++;
			}
			if (Character.getNumericValue(ch) != (i+1)%2) {
				ans2++;
			}
		} int i = 0; int i = 0; i 0 i < str.length() i str.length() str.length str i++ i++ i {
			char ch = str.charAt(i);
			if (Character.getNumericValue(ch) != i%2) {
				ans1++;
			}
			if (Character.getNumericValue(ch) != (i+1)%2) {
				ans2++;
			}
		} {
			char ch = str.charAt(i);
			if (Character.getNumericValue(ch) != i%2) {
				ans1++;
			}
			if (Character.getNumericValue(ch) != (i+1)%2) {
				ans2++;
			}
		} char ch = str.charAt(i); ch str.charAt(i) str.charAt str i if (Character.getNumericValue(ch) != i%2) {
				ans1++;
			} Character.getNumericValue(ch) != i%2 Character.getNumericValue(ch) Character.getNumericValue Character ch i%2 i 2 {
				ans1++;
			} ans1++ ans1 if (Character.getNumericValue(ch) != (i+1)%2) {
				ans2++;
			} Character.getNumericValue(ch) != (i+1)%2 Character.getNumericValue(ch) Character.getNumericValue Character ch (i+1)%2 (i+1) i 1 2 {
				ans2++;
			} ans2++ ans2 System.out.println(Math.min(ans1, ans2)) System.out.println System.out System System.out Math.min(ans1, ans2) Math.min Math ans1 ans2 reader.close() reader.close reader String[] args args public class Main {
	public static void main(String[] args) {
		Scanner reader = new Scanner(System.in);
		String str = reader.next();
		int ans1 = 0;
		int ans2 = 0;
		for (int i = 0; i < str.length(); i++) {
			char ch = str.charAt(i);
			if (Character.getNumericValue(ch) != i%2) {
				ans1++;
			}
			if (Character.getNumericValue(ch) != (i+1)%2) {
				ans2++;
			}
		}


		System.out.println(Math.min(ans1, ans2));
		reader.close();

	}

} public class Main {
	public static void main(String[] args) {
		Scanner reader = new Scanner(System.in);
		String str = reader.next();
		int ans1 = 0;
		int ans2 = 0;
		for (int i = 0; i < str.length(); i++) {
			char ch = str.charAt(i);
			if (Character.getNumericValue(ch) != i%2) {
				ans1++;
			}
			if (Character.getNumericValue(ch) != (i+1)%2) {
				ans2++;
			}
		}


		System.out.println(Math.min(ans1, ans2));
		reader.close();

	}

} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner reader = new Scanner(System.in);
		String str = reader.next();
		int ans1 = 0;
		int ans2 = 0;
		for (int i = 0; i < str.length(); i++) {
			char ch = str.charAt(i);
			if (Character.getNumericValue(ch) != i%2) {
				ans1++;
			}
			if (Character.getNumericValue(ch) != (i+1)%2) {
				ans2++;
			}
		}


		System.out.println(Math.min(ans1, ans2));
		reader.close();

	}

}



