import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		try (Scanner in = new Scanner(System.in)) {
			char[] s = in.next().toCharArray();
			
			int s_10_counter = 0;
			int s_01_counter = 0;
			
			
			for (int i = 0; i < s.length; i++) {
				if (i%2 == 1) {
					if (s[i] == '1') s_10_counter++;
					else s_01_counter++;
				} else {
					if (s[i] == '0') s_10_counter++;
					else s_01_counter++;
				}
			}
			
			System.out.println(s.length - Math.max(s_10_counter, s_01_counter));
			
		} catch (Exception e) {
			// TODO: handle exception
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		try (Scanner in = new Scanner(System.in)) {
			char[] s = in.next().toCharArray();
			
			int s_10_counter = 0;
			int s_01_counter = 0;
			
			
			for (int i = 0; i < s.length; i++) {
				if (i%2 == 1) {
					if (s[i] == '1') s_10_counter++;
					else s_01_counter++;
				} else {
					if (s[i] == '0') s_10_counter++;
					else s_01_counter++;
				}
			}
			
			System.out.println(s.length - Math.max(s_10_counter, s_01_counter));
			
		} catch (Exception e) {
			// TODO: handle exception
		}
	}
} Main public static void main(String[] args) {
		try (Scanner in = new Scanner(System.in)) {
			char[] s = in.next().toCharArray();
			
			int s_10_counter = 0;
			int s_01_counter = 0;
			
			
			for (int i = 0; i < s.length; i++) {
				if (i%2 == 1) {
					if (s[i] == '1') s_10_counter++;
					else s_01_counter++;
				} else {
					if (s[i] == '0') s_10_counter++;
					else s_01_counter++;
				}
			}
			
			System.out.println(s.length - Math.max(s_10_counter, s_01_counter));
			
		} catch (Exception e) {
			// TODO: handle exception
		}
	} main {
		try (Scanner in = new Scanner(System.in)) {
			char[] s = in.next().toCharArray();
			
			int s_10_counter = 0;
			int s_01_counter = 0;
			
			
			for (int i = 0; i < s.length; i++) {
				if (i%2 == 1) {
					if (s[i] == '1') s_10_counter++;
					else s_01_counter++;
				} else {
					if (s[i] == '0') s_10_counter++;
					else s_01_counter++;
				}
			}
			
			System.out.println(s.length - Math.max(s_10_counter, s_01_counter));
			
		} catch (Exception e) {
			// TODO: handle exception
		}
	} try (Scanner in = new Scanner(System.in)) {
			char[] s = in.next().toCharArray();
			
			int s_10_counter = 0;
			int s_01_counter = 0;
			
			
			for (int i = 0; i < s.length; i++) {
				if (i%2 == 1) {
					if (s[i] == '1') s_10_counter++;
					else s_01_counter++;
				} else {
					if (s[i] == '0') s_10_counter++;
					else s_01_counter++;
				}
			}
			
			System.out.println(s.length - Math.max(s_10_counter, s_01_counter));
			
		} catch (Exception e) {
			// TODO: handle exception
		} catch (Exception e) {
			// TODO: handle exception
		} Exception e {
			// TODO: handle exception
		} {
			char[] s = in.next().toCharArray();
			
			int s_10_counter = 0;
			int s_01_counter = 0;
			
			
			for (int i = 0; i < s.length; i++) {
				if (i%2 == 1) {
					if (s[i] == '1') s_10_counter++;
					else s_01_counter++;
				} else {
					if (s[i] == '0') s_10_counter++;
					else s_01_counter++;
				}
			}
			
			System.out.println(s.length - Math.max(s_10_counter, s_01_counter));
			
		} Scanner in = new Scanner(System.in) Scanner in = new Scanner(System.in) new Scanner(System.in) char[] s = in.next().toCharArray(); s in.next().toCharArray() in.next().toCharArray in.next() in.next in int s_10_counter = 0; s_10_counter 0 int s_01_counter = 0; s_01_counter 0 for (int i = 0; i < s.length; i++) {
				if (i%2 == 1) {
					if (s[i] == '1') s_10_counter++;
					else s_01_counter++;
				} else {
					if (s[i] == '0') s_10_counter++;
					else s_01_counter++;
				}
			} int i = 0; int i = 0; i 0 i < s.length i s.length s s.length i++ i++ i {
				if (i%2 == 1) {
					if (s[i] == '1') s_10_counter++;
					else s_01_counter++;
				} else {
					if (s[i] == '0') s_10_counter++;
					else s_01_counter++;
				}
			} {
				if (i%2 == 1) {
					if (s[i] == '1') s_10_counter++;
					else s_01_counter++;
				} else {
					if (s[i] == '0') s_10_counter++;
					else s_01_counter++;
				}
			} if (i%2 == 1) {
					if (s[i] == '1') s_10_counter++;
					else s_01_counter++;
				} else {
					if (s[i] == '0') s_10_counter++;
					else s_01_counter++;
				} i%2 == 1 i%2 i 2 1 {
					if (s[i] == '1') s_10_counter++;
					else s_01_counter++;
				} if (s[i] == '1') s_10_counter++;
					else s_01_counter++; s[i] == '1' s[i] s i '1' s_10_counter++ s_10_counter s_01_counter++ s_01_counter {
					if (s[i] == '0') s_10_counter++;
					else s_01_counter++;
				} if (s[i] == '0') s_10_counter++;
					else s_01_counter++; s[i] == '0' s[i] s i '0' s_10_counter++ s_10_counter s_01_counter++ s_01_counter System.out.println(s.length - Math.max(s_10_counter, s_01_counter)) System.out.println System.out System System.out s.length - Math.max(s_10_counter, s_01_counter) s.length s s.length Math.max(s_10_counter, s_01_counter) Math.max Math s_10_counter s_01_counter String[] args args public class Main {
	public static void main(String[] args) {
		try (Scanner in = new Scanner(System.in)) {
			char[] s = in.next().toCharArray();
			
			int s_10_counter = 0;
			int s_01_counter = 0;
			
			
			for (int i = 0; i < s.length; i++) {
				if (i%2 == 1) {
					if (s[i] == '1') s_10_counter++;
					else s_01_counter++;
				} else {
					if (s[i] == '0') s_10_counter++;
					else s_01_counter++;
				}
			}
			
			System.out.println(s.length - Math.max(s_10_counter, s_01_counter));
			
		} catch (Exception e) {
			// TODO: handle exception
		}
	}
} public class Main {
	public static void main(String[] args) {
		try (Scanner in = new Scanner(System.in)) {
			char[] s = in.next().toCharArray();
			
			int s_10_counter = 0;
			int s_01_counter = 0;
			
			
			for (int i = 0; i < s.length; i++) {
				if (i%2 == 1) {
					if (s[i] == '1') s_10_counter++;
					else s_01_counter++;
				} else {
					if (s[i] == '0') s_10_counter++;
					else s_01_counter++;
				}
			}
			
			System.out.println(s.length - Math.max(s_10_counter, s_01_counter));
			
		} catch (Exception e) {
			// TODO: handle exception
		}
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		try (Scanner in = new Scanner(System.in)) {
			char[] s = in.next().toCharArray();
			
			int s_10_counter = 0;
			int s_01_counter = 0;
			
			
			for (int i = 0; i < s.length; i++) {
				if (i%2 == 1) {
					if (s[i] == '1') s_10_counter++;
					else s_01_counter++;
				} else {
					if (s[i] == '0') s_10_counter++;
					else s_01_counter++;
				}
			}
			
			System.out.println(s.length - Math.max(s_10_counter, s_01_counter));
			
		} catch (Exception e) {
			// TODO: handle exception
		}
	}
}