import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String num = scan.nextLine();
		int diff0 = 0;
		int diff1 = 0;
		for (int i=0; i<num.length(); i++) {
			int sheet = Character.getNumericValue(num.charAt(i));
			if (i % 2 == 0) {
				if (sheet == 0) {
					diff1++;
				} else {
					diff0++;
				}
			} else {
				if (sheet == 0) {
					diff0++;
				} else {
					diff1++;
				}
			}
		}

		if (diff0 > diff1) {
			System.out.println(diff1);
		} else {
			System.out.println(diff0);
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String num = scan.nextLine();
		int diff0 = 0;
		int diff1 = 0;
		for (int i=0; i<num.length(); i++) {
			int sheet = Character.getNumericValue(num.charAt(i));
			if (i % 2 == 0) {
				if (sheet == 0) {
					diff1++;
				} else {
					diff0++;
				}
			} else {
				if (sheet == 0) {
					diff0++;
				} else {
					diff1++;
				}
			}
		}

		if (diff0 > diff1) {
			System.out.println(diff1);
		} else {
			System.out.println(diff0);
		}
	}
} Main public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String num = scan.nextLine();
		int diff0 = 0;
		int diff1 = 0;
		for (int i=0; i<num.length(); i++) {
			int sheet = Character.getNumericValue(num.charAt(i));
			if (i % 2 == 0) {
				if (sheet == 0) {
					diff1++;
				} else {
					diff0++;
				}
			} else {
				if (sheet == 0) {
					diff0++;
				} else {
					diff1++;
				}
			}
		}

		if (diff0 > diff1) {
			System.out.println(diff1);
		} else {
			System.out.println(diff0);
		}
	} main {
		Scanner scan = new Scanner(System.in);
		String num = scan.nextLine();
		int diff0 = 0;
		int diff1 = 0;
		for (int i=0; i<num.length(); i++) {
			int sheet = Character.getNumericValue(num.charAt(i));
			if (i % 2 == 0) {
				if (sheet == 0) {
					diff1++;
				} else {
					diff0++;
				}
			} else {
				if (sheet == 0) {
					diff0++;
				} else {
					diff1++;
				}
			}
		}

		if (diff0 > diff1) {
			System.out.println(diff1);
		} else {
			System.out.println(diff0);
		}
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) String num = scan.nextLine(); num scan.nextLine() scan.nextLine scan int diff0 = 0; diff0 0 int diff1 = 0; diff1 0 for (int i=0; i<num.length(); i++) {
			int sheet = Character.getNumericValue(num.charAt(i));
			if (i % 2 == 0) {
				if (sheet == 0) {
					diff1++;
				} else {
					diff0++;
				}
			} else {
				if (sheet == 0) {
					diff0++;
				} else {
					diff1++;
				}
			}
		} int i=0; int i=0; i 0 i<num.length() i num.length() num.length num i++ i++ i {
			int sheet = Character.getNumericValue(num.charAt(i));
			if (i % 2 == 0) {
				if (sheet == 0) {
					diff1++;
				} else {
					diff0++;
				}
			} else {
				if (sheet == 0) {
					diff0++;
				} else {
					diff1++;
				}
			}
		} {
			int sheet = Character.getNumericValue(num.charAt(i));
			if (i % 2 == 0) {
				if (sheet == 0) {
					diff1++;
				} else {
					diff0++;
				}
			} else {
				if (sheet == 0) {
					diff0++;
				} else {
					diff1++;
				}
			}
		} int sheet = Character.getNumericValue(num.charAt(i)); sheet Character.getNumericValue(num.charAt(i)) Character.getNumericValue Character num.charAt(i) num.charAt num i if (i % 2 == 0) {
				if (sheet == 0) {
					diff1++;
				} else {
					diff0++;
				}
			} else {
				if (sheet == 0) {
					diff0++;
				} else {
					diff1++;
				}
			} i % 2 == 0 i % 2 i 2 0 {
				if (sheet == 0) {
					diff1++;
				} else {
					diff0++;
				}
			} if (sheet == 0) {
					diff1++;
				} else {
					diff0++;
				} sheet == 0 sheet 0 {
					diff1++;
				} diff1++ diff1 {
					diff0++;
				} diff0++ diff0 {
				if (sheet == 0) {
					diff0++;
				} else {
					diff1++;
				}
			} if (sheet == 0) {
					diff0++;
				} else {
					diff1++;
				} sheet == 0 sheet 0 {
					diff0++;
				} diff0++ diff0 {
					diff1++;
				} diff1++ diff1 if (diff0 > diff1) {
			System.out.println(diff1);
		} else {
			System.out.println(diff0);
		} diff0 > diff1 diff0 diff1 {
			System.out.println(diff1);
		} System.out.println(diff1) System.out.println System.out System System.out diff1 {
			System.out.println(diff0);
		} System.out.println(diff0) System.out.println System.out System System.out diff0 String[] args args public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String num = scan.nextLine();
		int diff0 = 0;
		int diff1 = 0;
		for (int i=0; i<num.length(); i++) {
			int sheet = Character.getNumericValue(num.charAt(i));
			if (i % 2 == 0) {
				if (sheet == 0) {
					diff1++;
				} else {
					diff0++;
				}
			} else {
				if (sheet == 0) {
					diff0++;
				} else {
					diff1++;
				}
			}
		}

		if (diff0 > diff1) {
			System.out.println(diff1);
		} else {
			System.out.println(diff0);
		}
	}
} public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String num = scan.nextLine();
		int diff0 = 0;
		int diff1 = 0;
		for (int i=0; i<num.length(); i++) {
			int sheet = Character.getNumericValue(num.charAt(i));
			if (i % 2 == 0) {
				if (sheet == 0) {
					diff1++;
				} else {
					diff0++;
				}
			} else {
				if (sheet == 0) {
					diff0++;
				} else {
					diff1++;
				}
			}
		}

		if (diff0 > diff1) {
			System.out.println(diff1);
		} else {
			System.out.println(diff0);
		}
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String num = scan.nextLine();
		int diff0 = 0;
		int diff1 = 0;
		for (int i=0; i<num.length(); i++) {
			int sheet = Character.getNumericValue(num.charAt(i));
			if (i % 2 == 0) {
				if (sheet == 0) {
					diff1++;
				} else {
					diff0++;
				}
			} else {
				if (sheet == 0) {
					diff0++;
				} else {
					diff1++;
				}
			}
		}

		if (diff0 > diff1) {
			System.out.println(diff1);
		} else {
			System.out.println(diff0);
		}
	}
}