import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuilder s = new StringBuilder(sc.next());
		int answer = 0;

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

		for (int i = 1; i < s.length(); i++) {
			if (s.charAt(i) == s.charAt(i - 1)) {
				if (s.charAt(i) == '0') {
					s.setCharAt(i, '1');
				} else {
					s.setCharAt(i, '0');
				}
				answer++;
			}
		}
		System.out.println(answer);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuilder s = new StringBuilder(sc.next());
		int answer = 0;

		for (int i = 1; i < s.length(); i++) {
			if (s.charAt(i) == s.charAt(i - 1)) {
				if (s.charAt(i) == '0') {
					s.setCharAt(i, '1');
				} else {
					s.setCharAt(i, '0');
				}
				answer++;
			}
		}
		System.out.println(answer);
	} main {
		Scanner sc = new Scanner(System.in);
		StringBuilder s = new StringBuilder(sc.next());
		int answer = 0;

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

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

		for (int i = 1; i < s.length(); i++) {
			if (s.charAt(i) == s.charAt(i - 1)) {
				if (s.charAt(i) == '0') {
					s.setCharAt(i, '1');
				} else {
					s.setCharAt(i, '0');
				}
				answer++;
			}
		}
		System.out.println(answer);
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuilder s = new StringBuilder(sc.next());
		int answer = 0;

		for (int i = 1; i < s.length(); i++) {
			if (s.charAt(i) == s.charAt(i - 1)) {
				if (s.charAt(i) == '0') {
					s.setCharAt(i, '1');
				} else {
					s.setCharAt(i, '0');
				}
				answer++;
			}
		}
		System.out.println(answer);
	}
}
