import java.util.Scanner;

public class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		String tile = sc.nextLine();
		sc.close();
		int ans = tile.length();

		for (int i = 0; i < 2; i++) {
			int cnt = 0;

			for (int j = 0; j < tile.length(); j++) {
				int current = Integer.parseInt(String.valueOf(tile.charAt(j)));
				if (j % 2 == 0 && tile.charAt(j) != (char) (i + '0')) {
					cnt++;
				}
				if (j % 2 == 1 && tile.charAt(j) == (char) (i + '0')) {
					cnt++;
				}
			}
			ans = Math.min(ans, cnt);

		}
		System.out.println(ans);

	}

} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		String tile = sc.nextLine();
		sc.close();
		int ans = tile.length();

		for (int i = 0; i < 2; i++) {
			int cnt = 0;

			for (int j = 0; j < tile.length(); j++) {
				int current = Integer.parseInt(String.valueOf(tile.charAt(j)));
				if (j % 2 == 0 && tile.charAt(j) != (char) (i + '0')) {
					cnt++;
				}
				if (j % 2 == 1 && tile.charAt(j) == (char) (i + '0')) {
					cnt++;
				}
			}
			ans = Math.min(ans, cnt);

		}
		System.out.println(ans);

	}

} Main public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		String tile = sc.nextLine();
		sc.close();
		int ans = tile.length();

		for (int i = 0; i < 2; i++) {
			int cnt = 0;

			for (int j = 0; j < tile.length(); j++) {
				int current = Integer.parseInt(String.valueOf(tile.charAt(j)));
				if (j % 2 == 0 && tile.charAt(j) != (char) (i + '0')) {
					cnt++;
				}
				if (j % 2 == 1 && tile.charAt(j) == (char) (i + '0')) {
					cnt++;
				}
			}
			ans = Math.min(ans, cnt);

		}
		System.out.println(ans);

	} main {
		Scanner sc = new Scanner(System.in);
		String tile = sc.nextLine();
		sc.close();
		int ans = tile.length();

		for (int i = 0; i < 2; i++) {
			int cnt = 0;

			for (int j = 0; j < tile.length(); j++) {
				int current = Integer.parseInt(String.valueOf(tile.charAt(j)));
				if (j % 2 == 0 && tile.charAt(j) != (char) (i + '0')) {
					cnt++;
				}
				if (j % 2 == 1 && tile.charAt(j) == (char) (i + '0')) {
					cnt++;
				}
			}
			ans = Math.min(ans, cnt);

		}
		System.out.println(ans);

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String tile = sc.nextLine(); tile sc.nextLine() sc.nextLine sc sc.close() sc.close sc int ans = tile.length(); ans tile.length() tile.length tile for (int i = 0; i < 2; i++) {
			int cnt = 0;

			for (int j = 0; j < tile.length(); j++) {
				int current = Integer.parseInt(String.valueOf(tile.charAt(j)));
				if (j % 2 == 0 && tile.charAt(j) != (char) (i + '0')) {
					cnt++;
				}
				if (j % 2 == 1 && tile.charAt(j) == (char) (i + '0')) {
					cnt++;
				}
			}
			ans = Math.min(ans, cnt);

		} int i = 0; int i = 0; i 0 i < 2 i 2 i++ i++ i {
			int cnt = 0;

			for (int j = 0; j < tile.length(); j++) {
				int current = Integer.parseInt(String.valueOf(tile.charAt(j)));
				if (j % 2 == 0 && tile.charAt(j) != (char) (i + '0')) {
					cnt++;
				}
				if (j % 2 == 1 && tile.charAt(j) == (char) (i + '0')) {
					cnt++;
				}
			}
			ans = Math.min(ans, cnt);

		} {
			int cnt = 0;

			for (int j = 0; j < tile.length(); j++) {
				int current = Integer.parseInt(String.valueOf(tile.charAt(j)));
				if (j % 2 == 0 && tile.charAt(j) != (char) (i + '0')) {
					cnt++;
				}
				if (j % 2 == 1 && tile.charAt(j) == (char) (i + '0')) {
					cnt++;
				}
			}
			ans = Math.min(ans, cnt);

		} int cnt = 0; cnt 0 for (int j = 0; j < tile.length(); j++) {
				int current = Integer.parseInt(String.valueOf(tile.charAt(j)));
				if (j % 2 == 0 && tile.charAt(j) != (char) (i + '0')) {
					cnt++;
				}
				if (j % 2 == 1 && tile.charAt(j) == (char) (i + '0')) {
					cnt++;
				}
			} int j = 0; int j = 0; j 0 j < tile.length() j tile.length() tile.length tile j++ j++ j {
				int current = Integer.parseInt(String.valueOf(tile.charAt(j)));
				if (j % 2 == 0 && tile.charAt(j) != (char) (i + '0')) {
					cnt++;
				}
				if (j % 2 == 1 && tile.charAt(j) == (char) (i + '0')) {
					cnt++;
				}
			} {
				int current = Integer.parseInt(String.valueOf(tile.charAt(j)));
				if (j % 2 == 0 && tile.charAt(j) != (char) (i + '0')) {
					cnt++;
				}
				if (j % 2 == 1 && tile.charAt(j) == (char) (i + '0')) {
					cnt++;
				}
			} int current = Integer.parseInt(String.valueOf(tile.charAt(j))); current Integer.parseInt(String.valueOf(tile.charAt(j))) Integer.parseInt Integer String.valueOf(tile.charAt(j)) String.valueOf String tile.charAt(j) tile.charAt tile j if (j % 2 == 0 && tile.charAt(j) != (char) (i + '0')) {
					cnt++;
				} j % 2 == 0 && tile.charAt(j) != (char) (i + '0') j % 2 == 0 j % 2 j 2 0 tile.charAt(j) != (char) (i + '0') tile.charAt(j) tile.charAt tile j (char) (i + '0') i '0' {
					cnt++;
				} cnt++ cnt if (j % 2 == 1 && tile.charAt(j) == (char) (i + '0')) {
					cnt++;
				} j % 2 == 1 && tile.charAt(j) == (char) (i + '0') j % 2 == 1 j % 2 j 2 1 tile.charAt(j) == (char) (i + '0') tile.charAt(j) tile.charAt tile j (char) (i + '0') i '0' {
					cnt++;
				} cnt++ cnt ans = Math.min(ans, cnt) ans Math.min(ans, cnt) Math.min Math ans cnt 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 tile = sc.nextLine();
		sc.close();
		int ans = tile.length();

		for (int i = 0; i < 2; i++) {
			int cnt = 0;

			for (int j = 0; j < tile.length(); j++) {
				int current = Integer.parseInt(String.valueOf(tile.charAt(j)));
				if (j % 2 == 0 && tile.charAt(j) != (char) (i + '0')) {
					cnt++;
				}
				if (j % 2 == 1 && tile.charAt(j) == (char) (i + '0')) {
					cnt++;
				}
			}
			ans = Math.min(ans, cnt);

		}
		System.out.println(ans);

	}

} public class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		String tile = sc.nextLine();
		sc.close();
		int ans = tile.length();

		for (int i = 0; i < 2; i++) {
			int cnt = 0;

			for (int j = 0; j < tile.length(); j++) {
				int current = Integer.parseInt(String.valueOf(tile.charAt(j)));
				if (j % 2 == 0 && tile.charAt(j) != (char) (i + '0')) {
					cnt++;
				}
				if (j % 2 == 1 && tile.charAt(j) == (char) (i + '0')) {
					cnt++;
				}
			}
			ans = Math.min(ans, cnt);

		}
		System.out.println(ans);

	}

} Main
import java.util.Scanner;

public class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		String tile = sc.nextLine();
		sc.close();
		int ans = tile.length();

		for (int i = 0; i < 2; i++) {
			int cnt = 0;

			for (int j = 0; j < tile.length(); j++) {
				int current = Integer.parseInt(String.valueOf(tile.charAt(j)));
				if (j % 2 == 0 && tile.charAt(j) != (char) (i + '0')) {
					cnt++;
				}
				if (j % 2 == 1 && tile.charAt(j) == (char) (i + '0')) {
					cnt++;
				}
			}
			ans = Math.min(ans, cnt);

		}
		System.out.println(ans);

	}

}