import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		String line = scn.nextLine();
		int length = line.length();
		String S[] = line.split("");
		String answer = S[0].equals("0") ? "1" : "0";
		int count = 0;

		for(int i = 1;i < length;i++) {
			if(!S[i].equals(answer)) {
				count++;
			}
			answer = answer.equals("0") ? "1" : "0";
		}

		System.out.println(count);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		String line = scn.nextLine();
		int length = line.length();
		String S[] = line.split("");
		String answer = S[0].equals("0") ? "1" : "0";
		int count = 0;

		for(int i = 1;i < length;i++) {
			if(!S[i].equals(answer)) {
				count++;
			}
			answer = answer.equals("0") ? "1" : "0";
		}

		System.out.println(count);
	}
} Main public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		String line = scn.nextLine();
		int length = line.length();
		String S[] = line.split("");
		String answer = S[0].equals("0") ? "1" : "0";
		int count = 0;

		for(int i = 1;i < length;i++) {
			if(!S[i].equals(answer)) {
				count++;
			}
			answer = answer.equals("0") ? "1" : "0";
		}

		System.out.println(count);
	} main {
		Scanner scn = new Scanner(System.in);
		String line = scn.nextLine();
		int length = line.length();
		String S[] = line.split("");
		String answer = S[0].equals("0") ? "1" : "0";
		int count = 0;

		for(int i = 1;i < length;i++) {
			if(!S[i].equals(answer)) {
				count++;
			}
			answer = answer.equals("0") ? "1" : "0";
		}

		System.out.println(count);
	} Scanner scn = new Scanner(System.in); scn new Scanner(System.in) String line = scn.nextLine(); line scn.nextLine() scn.nextLine scn int length = line.length(); length line.length() line.length line String S[] = line.split(""); S line.split("") line.split line "" String answer = S[0].equals("0") ? "1" : "0"; answer S[0].equals("0") ? "1" : "0" S[0].equals("0") S[0].equals S[0] S 0 "0" "1" "0" int count = 0; count 0 for(int i = 1;i < length;i++) {
			if(!S[i].equals(answer)) {
				count++;
			}
			answer = answer.equals("0") ? "1" : "0";
		} int i = 1; int i = 1; i 1 i < length i length i++ i++ i {
			if(!S[i].equals(answer)) {
				count++;
			}
			answer = answer.equals("0") ? "1" : "0";
		} {
			if(!S[i].equals(answer)) {
				count++;
			}
			answer = answer.equals("0") ? "1" : "0";
		} if(!S[i].equals(answer)) {
				count++;
			} !S[i].equals(answer) S[i].equals(answer) S[i].equals S[i] S i answer {
				count++;
			} count++ count answer = answer.equals("0") ? "1" : "0" answer answer.equals("0") ? "1" : "0" answer.equals("0") answer.equals answer "0" "1" "0" 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 scn = new Scanner(System.in);
		String line = scn.nextLine();
		int length = line.length();
		String S[] = line.split("");
		String answer = S[0].equals("0") ? "1" : "0";
		int count = 0;

		for(int i = 1;i < length;i++) {
			if(!S[i].equals(answer)) {
				count++;
			}
			answer = answer.equals("0") ? "1" : "0";
		}

		System.out.println(count);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		String line = scn.nextLine();
		int length = line.length();
		String S[] = line.split("");
		String answer = S[0].equals("0") ? "1" : "0";
		int count = 0;

		for(int i = 1;i < length;i++) {
			if(!S[i].equals(answer)) {
				count++;
			}
			answer = answer.equals("0") ? "1" : "0";
		}

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

public class Main {
	public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		String line = scn.nextLine();
		int length = line.length();
		String S[] = line.split("");
		String answer = S[0].equals("0") ? "1" : "0";
		int count = 0;

		for(int i = 1;i < length;i++) {
			if(!S[i].equals(answer)) {
				count++;
			}
			answer = answer.equals("0") ? "1" : "0";
		}

		System.out.println(count);
	}
}
