import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);

		// input
		String input = scan.next();
		char[] tile = input.toCharArray();
		int len = tile.length;

		// check
		int count = 0;
		char color = tile[0];
		for (int i = 1; i < len; i++) {
			if (tile[i] == color) {
				if (color == '1') {
					tile[i] = '0';
					color = '0';
					count++;
				} else {
					tile[i] = '1';
					color = '1';
					count++;
				}
			} else {
				color = tile[i];
			}
		}

		// answer
		System.out.println(count);
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);

		// input
		String input = scan.next();
		char[] tile = input.toCharArray();
		int len = tile.length;

		// check
		int count = 0;
		char color = tile[0];
		for (int i = 1; i < len; i++) {
			if (tile[i] == color) {
				if (color == '1') {
					tile[i] = '0';
					color = '0';
					count++;
				} else {
					tile[i] = '1';
					color = '1';
					count++;
				}
			} else {
				color = tile[i];
			}
		}

		// answer
		System.out.println(count);
	}
} Main public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);

		// input
		String input = scan.next();
		char[] tile = input.toCharArray();
		int len = tile.length;

		// check
		int count = 0;
		char color = tile[0];
		for (int i = 1; i < len; i++) {
			if (tile[i] == color) {
				if (color == '1') {
					tile[i] = '0';
					color = '0';
					count++;
				} else {
					tile[i] = '1';
					color = '1';
					count++;
				}
			} else {
				color = tile[i];
			}
		}

		// answer
		System.out.println(count);
	} main {
		Scanner scan = new Scanner(System.in);

		// input
		String input = scan.next();
		char[] tile = input.toCharArray();
		int len = tile.length;

		// check
		int count = 0;
		char color = tile[0];
		for (int i = 1; i < len; i++) {
			if (tile[i] == color) {
				if (color == '1') {
					tile[i] = '0';
					color = '0';
					count++;
				} else {
					tile[i] = '1';
					color = '1';
					count++;
				}
			} else {
				color = tile[i];
			}
		}

		// answer
		System.out.println(count);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) String input = scan.next(); input scan.next() scan.next scan char[] tile = input.toCharArray(); tile input.toCharArray() input.toCharArray input int len = tile.length; len tile.length tile tile.length int count = 0; count 0 char color = tile[0]; color tile[0] tile 0 for (int i = 1; i < len; i++) {
			if (tile[i] == color) {
				if (color == '1') {
					tile[i] = '0';
					color = '0';
					count++;
				} else {
					tile[i] = '1';
					color = '1';
					count++;
				}
			} else {
				color = tile[i];
			}
		} int i = 1; int i = 1; i 1 i < len i len i++ i++ i {
			if (tile[i] == color) {
				if (color == '1') {
					tile[i] = '0';
					color = '0';
					count++;
				} else {
					tile[i] = '1';
					color = '1';
					count++;
				}
			} else {
				color = tile[i];
			}
		} {
			if (tile[i] == color) {
				if (color == '1') {
					tile[i] = '0';
					color = '0';
					count++;
				} else {
					tile[i] = '1';
					color = '1';
					count++;
				}
			} else {
				color = tile[i];
			}
		} if (tile[i] == color) {
				if (color == '1') {
					tile[i] = '0';
					color = '0';
					count++;
				} else {
					tile[i] = '1';
					color = '1';
					count++;
				}
			} else {
				color = tile[i];
			} tile[i] == color tile[i] tile i color {
				if (color == '1') {
					tile[i] = '0';
					color = '0';
					count++;
				} else {
					tile[i] = '1';
					color = '1';
					count++;
				}
			} if (color == '1') {
					tile[i] = '0';
					color = '0';
					count++;
				} else {
					tile[i] = '1';
					color = '1';
					count++;
				} color == '1' color '1' {
					tile[i] = '0';
					color = '0';
					count++;
				} tile[i] = '0' tile[i] tile i '0' color = '0' color '0' count++ count {
					tile[i] = '1';
					color = '1';
					count++;
				} tile[i] = '1' tile[i] tile i '1' color = '1' color '1' count++ count {
				color = tile[i];
			} color = tile[i] color tile[i] tile i System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);

		// input
		String input = scan.next();
		char[] tile = input.toCharArray();
		int len = tile.length;

		// check
		int count = 0;
		char color = tile[0];
		for (int i = 1; i < len; i++) {
			if (tile[i] == color) {
				if (color == '1') {
					tile[i] = '0';
					color = '0';
					count++;
				} else {
					tile[i] = '1';
					color = '1';
					count++;
				}
			} else {
				color = tile[i];
			}
		}

		// answer
		System.out.println(count);
	}
} public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);

		// input
		String input = scan.next();
		char[] tile = input.toCharArray();
		int len = tile.length;

		// check
		int count = 0;
		char color = tile[0];
		for (int i = 1; i < len; i++) {
			if (tile[i] == color) {
				if (color == '1') {
					tile[i] = '0';
					color = '0';
					count++;
				} else {
					tile[i] = '1';
					color = '1';
					count++;
				}
			} else {
				color = tile[i];
			}
		}

		// answer
		System.out.println(count);
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);

		// input
		String input = scan.next();
		char[] tile = input.toCharArray();
		int len = tile.length;

		// check
		int count = 0;
		char color = tile[0];
		for (int i = 1; i < len; i++) {
			if (tile[i] == color) {
				if (color == '1') {
					tile[i] = '0';
					color = '0';
					count++;
				} else {
					tile[i] = '1';
					color = '1';
					count++;
				}
			} else {
				color = tile[i];
			}
		}

		// answer
		System.out.println(count);
	}
}
