import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] C = sc.next().toCharArray();
		sc.close();

		// 初めを"0"と仮定して合わない数を探す
		int correct = 0;
		for (int i = 0; i < C.length; i++) {
			char compare = i % 2 == 0 ? '0' : '1';
			if (C[i] == compare) {
				correct++;
			}
		}
		int ans = Math.min(correct, C.length - correct);
		System.out.println(ans);
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] C = sc.next().toCharArray();
		sc.close();

		// 初めを"0"と仮定して合わない数を探す
		int correct = 0;
		for (int i = 0; i < C.length; i++) {
			char compare = i % 2 == 0 ? '0' : '1';
			if (C[i] == compare) {
				correct++;
			}
		}
		int ans = Math.min(correct, C.length - correct);
		System.out.println(ans);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] C = sc.next().toCharArray();
		sc.close();

		// 初めを"0"と仮定して合わない数を探す
		int correct = 0;
		for (int i = 0; i < C.length; i++) {
			char compare = i % 2 == 0 ? '0' : '1';
			if (C[i] == compare) {
				correct++;
			}
		}
		int ans = Math.min(correct, C.length - correct);
		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		char[] C = sc.next().toCharArray();
		sc.close();

		// 初めを"0"と仮定して合わない数を探す
		int correct = 0;
		for (int i = 0; i < C.length; i++) {
			char compare = i % 2 == 0 ? '0' : '1';
			if (C[i] == compare) {
				correct++;
			}
		}
		int ans = Math.min(correct, C.length - correct);
		System.out.println(ans);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) char[] C = sc.next().toCharArray(); C sc.next().toCharArray() sc.next().toCharArray sc.next() sc.next sc sc.close() sc.close sc int correct = 0; correct 0 for (int i = 0; i < C.length; i++) {
			char compare = i % 2 == 0 ? '0' : '1';
			if (C[i] == compare) {
				correct++;
			}
		} int i = 0; int i = 0; i 0 i < C.length i C.length C C.length i++ i++ i {
			char compare = i % 2 == 0 ? '0' : '1';
			if (C[i] == compare) {
				correct++;
			}
		} {
			char compare = i % 2 == 0 ? '0' : '1';
			if (C[i] == compare) {
				correct++;
			}
		} char compare = i % 2 == 0 ? '0' : '1'; compare i % 2 == 0 ? '0' : '1' i % 2 == 0 i % 2 i 2 0 '0' '1' if (C[i] == compare) {
				correct++;
			} C[i] == compare C[i] C i compare {
				correct++;
			} correct++ correct int ans = Math.min(correct, C.length - correct); ans Math.min(correct, C.length - correct) Math.min Math correct C.length - correct C.length C C.length correct System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] C = sc.next().toCharArray();
		sc.close();

		// 初めを"0"と仮定して合わない数を探す
		int correct = 0;
		for (int i = 0; i < C.length; i++) {
			char compare = i % 2 == 0 ? '0' : '1';
			if (C[i] == compare) {
				correct++;
			}
		}
		int ans = Math.min(correct, C.length - correct);
		System.out.println(ans);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] C = sc.next().toCharArray();
		sc.close();

		// 初めを"0"と仮定して合わない数を探す
		int correct = 0;
		for (int i = 0; i < C.length; i++) {
			char compare = i % 2 == 0 ? '0' : '1';
			if (C[i] == compare) {
				correct++;
			}
		}
		int ans = Math.min(correct, C.length - correct);
		System.out.println(ans);
	}
} Main
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] C = sc.next().toCharArray();
		sc.close();

		// 初めを"0"と仮定して合わない数を探す
		int correct = 0;
		for (int i = 0; i < C.length; i++) {
			char compare = i % 2 == 0 ? '0' : '1';
			if (C[i] == compare) {
				correct++;
			}
		}
		int ans = Math.min(correct, C.length - correct);
		System.out.println(ans);
	}
}
