import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			char[] s = scanner.next().toCharArray();
			int count1 = 0, count2 = 0;
			for (int i = 0; i < s.length; i++) {
				char t = (0 == (i & 1)) ? '0' : '1';
				if (s[i] != t) {
					count1++;
				} else {
					count2++;
				}
			}
			System.out.println(Math.min(count1, count2));
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			char[] s = scanner.next().toCharArray();
			int count1 = 0, count2 = 0;
			for (int i = 0; i < s.length; i++) {
				char t = (0 == (i & 1)) ? '0' : '1';
				if (s[i] != t) {
					count1++;
				} else {
					count2++;
				}
			}
			System.out.println(Math.min(count1, count2));
		}
	}
} Main public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			char[] s = scanner.next().toCharArray();
			int count1 = 0, count2 = 0;
			for (int i = 0; i < s.length; i++) {
				char t = (0 == (i & 1)) ? '0' : '1';
				if (s[i] != t) {
					count1++;
				} else {
					count2++;
				}
			}
			System.out.println(Math.min(count1, count2));
		}
	} main {
		try (Scanner scanner = new Scanner(System.in)) {
			char[] s = scanner.next().toCharArray();
			int count1 = 0, count2 = 0;
			for (int i = 0; i < s.length; i++) {
				char t = (0 == (i & 1)) ? '0' : '1';
				if (s[i] != t) {
					count1++;
				} else {
					count2++;
				}
			}
			System.out.println(Math.min(count1, count2));
		}
	} try (Scanner scanner = new Scanner(System.in)) {
			char[] s = scanner.next().toCharArray();
			int count1 = 0, count2 = 0;
			for (int i = 0; i < s.length; i++) {
				char t = (0 == (i & 1)) ? '0' : '1';
				if (s[i] != t) {
					count1++;
				} else {
					count2++;
				}
			}
			System.out.println(Math.min(count1, count2));
		} {
			char[] s = scanner.next().toCharArray();
			int count1 = 0, count2 = 0;
			for (int i = 0; i < s.length; i++) {
				char t = (0 == (i & 1)) ? '0' : '1';
				if (s[i] != t) {
					count1++;
				} else {
					count2++;
				}
			}
			System.out.println(Math.min(count1, count2));
		} Scanner scanner = new Scanner(System.in) Scanner scanner = new Scanner(System.in) new Scanner(System.in) char[] s = scanner.next().toCharArray(); s scanner.next().toCharArray() scanner.next().toCharArray scanner.next() scanner.next scanner int count1 = 0 count1 0 count2 = 0; count2 0 for (int i = 0; i < s.length; i++) {
				char t = (0 == (i & 1)) ? '0' : '1';
				if (s[i] != t) {
					count1++;
				} else {
					count2++;
				}
			} int i = 0; int i = 0; i 0 i < s.length i s.length s s.length i++ i++ i {
				char t = (0 == (i & 1)) ? '0' : '1';
				if (s[i] != t) {
					count1++;
				} else {
					count2++;
				}
			} {
				char t = (0 == (i & 1)) ? '0' : '1';
				if (s[i] != t) {
					count1++;
				} else {
					count2++;
				}
			} char t = (0 == (i & 1)) ? '0' : '1'; t (0 == (i & 1)) ? '0' : '1' (0 == (i & 1)) 0 (i & 1) i 1 '0' '1' if (s[i] != t) {
					count1++;
				} else {
					count2++;
				} s[i] != t s[i] s i t {
					count1++;
				} count1++ count1 {
					count2++;
				} count2++ count2 System.out.println(Math.min(count1, count2)) System.out.println System.out System System.out Math.min(count1, count2) Math.min Math count1 count2 String[] args args public class Main {

	public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			char[] s = scanner.next().toCharArray();
			int count1 = 0, count2 = 0;
			for (int i = 0; i < s.length; i++) {
				char t = (0 == (i & 1)) ? '0' : '1';
				if (s[i] != t) {
					count1++;
				} else {
					count2++;
				}
			}
			System.out.println(Math.min(count1, count2));
		}
	}
} public class Main {

	public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			char[] s = scanner.next().toCharArray();
			int count1 = 0, count2 = 0;
			for (int i = 0; i < s.length; i++) {
				char t = (0 == (i & 1)) ? '0' : '1';
				if (s[i] != t) {
					count1++;
				} else {
					count2++;
				}
			}
			System.out.println(Math.min(count1, count2));
		}
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			char[] s = scanner.next().toCharArray();
			int count1 = 0, count2 = 0;
			for (int i = 0; i < s.length; i++) {
				char t = (0 == (i & 1)) ? '0' : '1';
				if (s[i] != t) {
					count1++;
				} else {
					count2++;
				}
			}
			System.out.println(Math.min(count1, count2));
		}
	}
}
