
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		String S = scanner.next();
		int N = S.length();
		int ans = 0;
		char[] S2A = new char[N];
		S2A[0] = S.charAt(0);
		if (N == 1) {
			ans = 0;
		} else {
			for (int i = 1; i < N; i++) {
				S2A[i] = S.charAt(i);
				if(func(S2A[i], S2A[i-1])) {
					ans++;
					if(S2A[i-1] == '0') {
						S2A[i] = '1';
					}else {
						S2A[i] = '0';
					}
				}
			}
		}
		System.out.println(ans);
		scanner.close();
	}

	public static boolean func(char c, char pre) {
		char cs;
		if (pre == '0') {
			cs = '1';
		} else {
			cs = '0';
		}
		if (c != cs) {
			c = cs;
			return true;
		}
		return false;
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		String S = scanner.next();
		int N = S.length();
		int ans = 0;
		char[] S2A = new char[N];
		S2A[0] = S.charAt(0);
		if (N == 1) {
			ans = 0;
		} else {
			for (int i = 1; i < N; i++) {
				S2A[i] = S.charAt(i);
				if(func(S2A[i], S2A[i-1])) {
					ans++;
					if(S2A[i-1] == '0') {
						S2A[i] = '1';
					}else {
						S2A[i] = '0';
					}
				}
			}
		}
		System.out.println(ans);
		scanner.close();
	}

	public static boolean func(char c, char pre) {
		char cs;
		if (pre == '0') {
			cs = '1';
		} else {
			cs = '0';
		}
		if (c != cs) {
			c = cs;
			return true;
		}
		return false;
	}
} Main public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		String S = scanner.next();
		int N = S.length();
		int ans = 0;
		char[] S2A = new char[N];
		S2A[0] = S.charAt(0);
		if (N == 1) {
			ans = 0;
		} else {
			for (int i = 1; i < N; i++) {
				S2A[i] = S.charAt(i);
				if(func(S2A[i], S2A[i-1])) {
					ans++;
					if(S2A[i-1] == '0') {
						S2A[i] = '1';
					}else {
						S2A[i] = '0';
					}
				}
			}
		}
		System.out.println(ans);
		scanner.close();
	} main {
		Scanner scanner = new Scanner(System.in);
		String S = scanner.next();
		int N = S.length();
		int ans = 0;
		char[] S2A = new char[N];
		S2A[0] = S.charAt(0);
		if (N == 1) {
			ans = 0;
		} else {
			for (int i = 1; i < N; i++) {
				S2A[i] = S.charAt(i);
				if(func(S2A[i], S2A[i-1])) {
					ans++;
					if(S2A[i-1] == '0') {
						S2A[i] = '1';
					}else {
						S2A[i] = '0';
					}
				}
			}
		}
		System.out.println(ans);
		scanner.close();
	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) String S = scanner.next(); S scanner.next() scanner.next scanner int N = S.length(); N S.length() S.length S int ans = 0; ans 0 char[] S2A = new char[N]; S2A new char[N] N S2A[0] = S.charAt(0) S2A[0] S2A 0 S.charAt(0) S.charAt S 0 if (N == 1) {
			ans = 0;
		} else {
			for (int i = 1; i < N; i++) {
				S2A[i] = S.charAt(i);
				if(func(S2A[i], S2A[i-1])) {
					ans++;
					if(S2A[i-1] == '0') {
						S2A[i] = '1';
					}else {
						S2A[i] = '0';
					}
				}
			}
		} N == 1 N 1 {
			ans = 0;
		} ans = 0 ans 0 {
			for (int i = 1; i < N; i++) {
				S2A[i] = S.charAt(i);
				if(func(S2A[i], S2A[i-1])) {
					ans++;
					if(S2A[i-1] == '0') {
						S2A[i] = '1';
					}else {
						S2A[i] = '0';
					}
				}
			}
		} for (int i = 1; i < N; i++) {
				S2A[i] = S.charAt(i);
				if(func(S2A[i], S2A[i-1])) {
					ans++;
					if(S2A[i-1] == '0') {
						S2A[i] = '1';
					}else {
						S2A[i] = '0';
					}
				}
			} int i = 1; int i = 1; i 1 i < N i N i++ i++ i {
				S2A[i] = S.charAt(i);
				if(func(S2A[i], S2A[i-1])) {
					ans++;
					if(S2A[i-1] == '0') {
						S2A[i] = '1';
					}else {
						S2A[i] = '0';
					}
				}
			} {
				S2A[i] = S.charAt(i);
				if(func(S2A[i], S2A[i-1])) {
					ans++;
					if(S2A[i-1] == '0') {
						S2A[i] = '1';
					}else {
						S2A[i] = '0';
					}
				}
			} S2A[i] = S.charAt(i) S2A[i] S2A i S.charAt(i) S.charAt S i if(func(S2A[i], S2A[i-1])) {
					ans++;
					if(S2A[i-1] == '0') {
						S2A[i] = '1';
					}else {
						S2A[i] = '0';
					}
				} func(S2A[i], S2A[i-1]) func S2A[i] S2A i S2A[i-1] S2A i-1 i 1 {
					ans++;
					if(S2A[i-1] == '0') {
						S2A[i] = '1';
					}else {
						S2A[i] = '0';
					}
				} ans++ ans if(S2A[i-1] == '0') {
						S2A[i] = '1';
					}else {
						S2A[i] = '0';
					} S2A[i-1] == '0' S2A[i-1] S2A i-1 i 1 '0' {
						S2A[i] = '1';
					} S2A[i] = '1' S2A[i] S2A i '1' {
						S2A[i] = '0';
					} S2A[i] = '0' S2A[i] S2A i '0' System.out.println(ans) System.out.println System.out System System.out ans scanner.close() scanner.close scanner String[] args args public static boolean func(char c, char pre) {
		char cs;
		if (pre == '0') {
			cs = '1';
		} else {
			cs = '0';
		}
		if (c != cs) {
			c = cs;
			return true;
		}
		return false;
	} func {
		char cs;
		if (pre == '0') {
			cs = '1';
		} else {
			cs = '0';
		}
		if (c != cs) {
			c = cs;
			return true;
		}
		return false;
	} char cs; cs if (pre == '0') {
			cs = '1';
		} else {
			cs = '0';
		} pre == '0' pre '0' {
			cs = '1';
		} cs = '1' cs '1' {
			cs = '0';
		} cs = '0' cs '0' if (c != cs) {
			c = cs;
			return true;
		} c != cs c cs {
			c = cs;
			return true;
		} c = cs c cs return true; true return false; false char c c char pre pre public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		String S = scanner.next();
		int N = S.length();
		int ans = 0;
		char[] S2A = new char[N];
		S2A[0] = S.charAt(0);
		if (N == 1) {
			ans = 0;
		} else {
			for (int i = 1; i < N; i++) {
				S2A[i] = S.charAt(i);
				if(func(S2A[i], S2A[i-1])) {
					ans++;
					if(S2A[i-1] == '0') {
						S2A[i] = '1';
					}else {
						S2A[i] = '0';
					}
				}
			}
		}
		System.out.println(ans);
		scanner.close();
	}

	public static boolean func(char c, char pre) {
		char cs;
		if (pre == '0') {
			cs = '1';
		} else {
			cs = '0';
		}
		if (c != cs) {
			c = cs;
			return true;
		}
		return false;
	}
} public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		String S = scanner.next();
		int N = S.length();
		int ans = 0;
		char[] S2A = new char[N];
		S2A[0] = S.charAt(0);
		if (N == 1) {
			ans = 0;
		} else {
			for (int i = 1; i < N; i++) {
				S2A[i] = S.charAt(i);
				if(func(S2A[i], S2A[i-1])) {
					ans++;
					if(S2A[i-1] == '0') {
						S2A[i] = '1';
					}else {
						S2A[i] = '0';
					}
				}
			}
		}
		System.out.println(ans);
		scanner.close();
	}

	public static boolean func(char c, char pre) {
		char cs;
		if (pre == '0') {
			cs = '1';
		} else {
			cs = '0';
		}
		if (c != cs) {
			c = cs;
			return true;
		}
		return false;
	}
} Main

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		String S = scanner.next();
		int N = S.length();
		int ans = 0;
		char[] S2A = new char[N];
		S2A[0] = S.charAt(0);
		if (N == 1) {
			ans = 0;
		} else {
			for (int i = 1; i < N; i++) {
				S2A[i] = S.charAt(i);
				if(func(S2A[i], S2A[i-1])) {
					ans++;
					if(S2A[i-1] == '0') {
						S2A[i] = '1';
					}else {
						S2A[i] = '0';
					}
				}
			}
		}
		System.out.println(ans);
		scanner.close();
	}

	public static boolean func(char c, char pre) {
		char cs;
		if (pre == '0') {
			cs = '1';
		} else {
			cs = '0';
		}
		if (c != cs) {
			c = cs;
			return true;
		}
		return false;
	}
}
