import java.util.*;

/**
 * Main
 */
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		String S = sc.next();
		int N = S.length();
		String color[] = new String[N];
		int ans = 0;
		int count = 0;
		for (int i = 0; i < N; i++) {
			color[i] = S.substring(i, i + 1);
		}

		for (int i = 0; i < N; i++) {
			if (i % 2 == 0) {
				if (color[i].equals("0")) {
					count++;
				}
			} else {
				if (color[i].equals("1")) {
					count++;
				}
			}
		}
		ans = count;
		count = 0;

		for (int i = 0; i < N; i++) {
			if (i % 2 != 0) {
				if (color[i].equals("0")) {
					count++;
				}
			} else {
				if (color[i].equals("1")) {
					count++;
				}
			}
		}

		ans = Math.min(ans, count);

		sc.close();

		System.out.println(ans);
	}
}; import java.util.*; util.* java public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		String S = sc.next();
		int N = S.length();
		String color[] = new String[N];
		int ans = 0;
		int count = 0;
		for (int i = 0; i < N; i++) {
			color[i] = S.substring(i, i + 1);
		}

		for (int i = 0; i < N; i++) {
			if (i % 2 == 0) {
				if (color[i].equals("0")) {
					count++;
				}
			} else {
				if (color[i].equals("1")) {
					count++;
				}
			}
		}
		ans = count;
		count = 0;

		for (int i = 0; i < N; i++) {
			if (i % 2 != 0) {
				if (color[i].equals("0")) {
					count++;
				}
			} else {
				if (color[i].equals("1")) {
					count++;
				}
			}
		}

		ans = Math.min(ans, count);

		sc.close();

		System.out.println(ans);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		String S = sc.next();
		int N = S.length();
		String color[] = new String[N];
		int ans = 0;
		int count = 0;
		for (int i = 0; i < N; i++) {
			color[i] = S.substring(i, i + 1);
		}

		for (int i = 0; i < N; i++) {
			if (i % 2 == 0) {
				if (color[i].equals("0")) {
					count++;
				}
			} else {
				if (color[i].equals("1")) {
					count++;
				}
			}
		}
		ans = count;
		count = 0;

		for (int i = 0; i < N; i++) {
			if (i % 2 != 0) {
				if (color[i].equals("0")) {
					count++;
				}
			} else {
				if (color[i].equals("1")) {
					count++;
				}
			}
		}

		ans = Math.min(ans, count);

		sc.close();

		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		String S = sc.next();
		int N = S.length();
		String color[] = new String[N];
		int ans = 0;
		int count = 0;
		for (int i = 0; i < N; i++) {
			color[i] = S.substring(i, i + 1);
		}

		for (int i = 0; i < N; i++) {
			if (i % 2 == 0) {
				if (color[i].equals("0")) {
					count++;
				}
			} else {
				if (color[i].equals("1")) {
					count++;
				}
			}
		}
		ans = count;
		count = 0;

		for (int i = 0; i < N; i++) {
			if (i % 2 != 0) {
				if (color[i].equals("0")) {
					count++;
				}
			} else {
				if (color[i].equals("1")) {
					count++;
				}
			}
		}

		ans = Math.min(ans, count);

		sc.close();

		System.out.println(ans);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.next(); S sc.next() sc.next sc int N = S.length(); N S.length() S.length S String color[] = new String[N]; color new String[N] N int ans = 0; ans 0 int count = 0; count 0 for (int i = 0; i < N; i++) {
			color[i] = S.substring(i, i + 1);
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			color[i] = S.substring(i, i + 1);
		} {
			color[i] = S.substring(i, i + 1);
		} color[i] = S.substring(i, i + 1) color[i] color i S.substring(i, i + 1) S.substring S i i + 1 i 1 for (int i = 0; i < N; i++) {
			if (i % 2 == 0) {
				if (color[i].equals("0")) {
					count++;
				}
			} else {
				if (color[i].equals("1")) {
					count++;
				}
			}
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			if (i % 2 == 0) {
				if (color[i].equals("0")) {
					count++;
				}
			} else {
				if (color[i].equals("1")) {
					count++;
				}
			}
		} {
			if (i % 2 == 0) {
				if (color[i].equals("0")) {
					count++;
				}
			} else {
				if (color[i].equals("1")) {
					count++;
				}
			}
		} if (i % 2 == 0) {
				if (color[i].equals("0")) {
					count++;
				}
			} else {
				if (color[i].equals("1")) {
					count++;
				}
			} i % 2 == 0 i % 2 i 2 0 {
				if (color[i].equals("0")) {
					count++;
				}
			} if (color[i].equals("0")) {
					count++;
				} color[i].equals("0") color[i].equals color[i] color i "0" {
					count++;
				} count++ count {
				if (color[i].equals("1")) {
					count++;
				}
			} if (color[i].equals("1")) {
					count++;
				} color[i].equals("1") color[i].equals color[i] color i "1" {
					count++;
				} count++ count ans = count ans count count = 0 count 0 for (int i = 0; i < N; i++) {
			if (i % 2 != 0) {
				if (color[i].equals("0")) {
					count++;
				}
			} else {
				if (color[i].equals("1")) {
					count++;
				}
			}
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			if (i % 2 != 0) {
				if (color[i].equals("0")) {
					count++;
				}
			} else {
				if (color[i].equals("1")) {
					count++;
				}
			}
		} {
			if (i % 2 != 0) {
				if (color[i].equals("0")) {
					count++;
				}
			} else {
				if (color[i].equals("1")) {
					count++;
				}
			}
		} if (i % 2 != 0) {
				if (color[i].equals("0")) {
					count++;
				}
			} else {
				if (color[i].equals("1")) {
					count++;
				}
			} i % 2 != 0 i % 2 i 2 0 {
				if (color[i].equals("0")) {
					count++;
				}
			} if (color[i].equals("0")) {
					count++;
				} color[i].equals("0") color[i].equals color[i] color i "0" {
					count++;
				} count++ count {
				if (color[i].equals("1")) {
					count++;
				}
			} if (color[i].equals("1")) {
					count++;
				} color[i].equals("1") color[i].equals color[i] color i "1" {
					count++;
				} count++ count ans = Math.min(ans, count) ans Math.min(ans, count) Math.min Math ans count sc.close() sc.close sc 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);
		// 整数の入力
		String S = sc.next();
		int N = S.length();
		String color[] = new String[N];
		int ans = 0;
		int count = 0;
		for (int i = 0; i < N; i++) {
			color[i] = S.substring(i, i + 1);
		}

		for (int i = 0; i < N; i++) {
			if (i % 2 == 0) {
				if (color[i].equals("0")) {
					count++;
				}
			} else {
				if (color[i].equals("1")) {
					count++;
				}
			}
		}
		ans = count;
		count = 0;

		for (int i = 0; i < N; i++) {
			if (i % 2 != 0) {
				if (color[i].equals("0")) {
					count++;
				}
			} else {
				if (color[i].equals("1")) {
					count++;
				}
			}
		}

		ans = Math.min(ans, count);

		sc.close();

		System.out.println(ans);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		String S = sc.next();
		int N = S.length();
		String color[] = new String[N];
		int ans = 0;
		int count = 0;
		for (int i = 0; i < N; i++) {
			color[i] = S.substring(i, i + 1);
		}

		for (int i = 0; i < N; i++) {
			if (i % 2 == 0) {
				if (color[i].equals("0")) {
					count++;
				}
			} else {
				if (color[i].equals("1")) {
					count++;
				}
			}
		}
		ans = count;
		count = 0;

		for (int i = 0; i < N; i++) {
			if (i % 2 != 0) {
				if (color[i].equals("0")) {
					count++;
				}
			} else {
				if (color[i].equals("1")) {
					count++;
				}
			}
		}

		ans = Math.min(ans, count);

		sc.close();

		System.out.println(ans);
	}
} Main
import java.util.*;

/**
 * Main
 */
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		String S = sc.next();
		int N = S.length();
		String color[] = new String[N];
		int ans = 0;
		int count = 0;
		for (int i = 0; i < N; i++) {
			color[i] = S.substring(i, i + 1);
		}

		for (int i = 0; i < N; i++) {
			if (i % 2 == 0) {
				if (color[i].equals("0")) {
					count++;
				}
			} else {
				if (color[i].equals("1")) {
					count++;
				}
			}
		}
		ans = count;
		count = 0;

		for (int i = 0; i < N; i++) {
			if (i % 2 != 0) {
				if (color[i].equals("0")) {
					count++;
				}
			} else {
				if (color[i].equals("1")) {
					count++;
				}
			}
		}

		ans = Math.min(ans, count);

		sc.close();

		System.out.println(ans);
	}
};