import java.util.*;
 
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] s = sc.next().toCharArray();
		int n = s.length;
		char zero = '0';
		char one = '1';
		// 0101...
		int t1 = 0;
		for (int i = 0; i < n; i++) {
			if (i % 2 == 0) {
				if (s[i] != zero) {
					t1++;
				}
			} else {
				if (s[i] != one) {
					t1++;
				}
			}
		}
		int t2 = 0;
		for (int i = 0; i < n; i++) {
			if (i % 2 == 0) {
				if (s[i] != one) {
					t2++;
				}
			} else {
				if (s[i] != zero) {
					t2++;
				}
			}
		}
		System.out.println(Math.min(t1, t2));
	}
}

 
 

 
 
 
  import java.util.*; util.* java public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] s = sc.next().toCharArray();
		int n = s.length;
		char zero = '0';
		char one = '1';
		// 0101...
		int t1 = 0;
		for (int i = 0; i < n; i++) {
			if (i % 2 == 0) {
				if (s[i] != zero) {
					t1++;
				}
			} else {
				if (s[i] != one) {
					t1++;
				}
			}
		}
		int t2 = 0;
		for (int i = 0; i < n; i++) {
			if (i % 2 == 0) {
				if (s[i] != one) {
					t2++;
				}
			} else {
				if (s[i] != zero) {
					t2++;
				}
			}
		}
		System.out.println(Math.min(t1, t2));
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] s = sc.next().toCharArray();
		int n = s.length;
		char zero = '0';
		char one = '1';
		// 0101...
		int t1 = 0;
		for (int i = 0; i < n; i++) {
			if (i % 2 == 0) {
				if (s[i] != zero) {
					t1++;
				}
			} else {
				if (s[i] != one) {
					t1++;
				}
			}
		}
		int t2 = 0;
		for (int i = 0; i < n; i++) {
			if (i % 2 == 0) {
				if (s[i] != one) {
					t2++;
				}
			} else {
				if (s[i] != zero) {
					t2++;
				}
			}
		}
		System.out.println(Math.min(t1, t2));
	} main {
		Scanner sc = new Scanner(System.in);
		char[] s = sc.next().toCharArray();
		int n = s.length;
		char zero = '0';
		char one = '1';
		// 0101...
		int t1 = 0;
		for (int i = 0; i < n; i++) {
			if (i % 2 == 0) {
				if (s[i] != zero) {
					t1++;
				}
			} else {
				if (s[i] != one) {
					t1++;
				}
			}
		}
		int t2 = 0;
		for (int i = 0; i < n; i++) {
			if (i % 2 == 0) {
				if (s[i] != one) {
					t2++;
				}
			} else {
				if (s[i] != zero) {
					t2++;
				}
			}
		}
		System.out.println(Math.min(t1, t2));
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) char[] s = sc.next().toCharArray(); s sc.next().toCharArray() sc.next().toCharArray sc.next() sc.next sc int n = s.length; n s.length s s.length char zero = '0'; zero '0' char one = '1'; one '1' int t1 = 0; t1 0 for (int i = 0; i < n; i++) {
			if (i % 2 == 0) {
				if (s[i] != zero) {
					t1++;
				}
			} else {
				if (s[i] != one) {
					t1++;
				}
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			if (i % 2 == 0) {
				if (s[i] != zero) {
					t1++;
				}
			} else {
				if (s[i] != one) {
					t1++;
				}
			}
		} {
			if (i % 2 == 0) {
				if (s[i] != zero) {
					t1++;
				}
			} else {
				if (s[i] != one) {
					t1++;
				}
			}
		} if (i % 2 == 0) {
				if (s[i] != zero) {
					t1++;
				}
			} else {
				if (s[i] != one) {
					t1++;
				}
			} i % 2 == 0 i % 2 i 2 0 {
				if (s[i] != zero) {
					t1++;
				}
			} if (s[i] != zero) {
					t1++;
				} s[i] != zero s[i] s i zero {
					t1++;
				} t1++ t1 {
				if (s[i] != one) {
					t1++;
				}
			} if (s[i] != one) {
					t1++;
				} s[i] != one s[i] s i one {
					t1++;
				} t1++ t1 int t2 = 0; t2 0 for (int i = 0; i < n; i++) {
			if (i % 2 == 0) {
				if (s[i] != one) {
					t2++;
				}
			} else {
				if (s[i] != zero) {
					t2++;
				}
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			if (i % 2 == 0) {
				if (s[i] != one) {
					t2++;
				}
			} else {
				if (s[i] != zero) {
					t2++;
				}
			}
		} {
			if (i % 2 == 0) {
				if (s[i] != one) {
					t2++;
				}
			} else {
				if (s[i] != zero) {
					t2++;
				}
			}
		} if (i % 2 == 0) {
				if (s[i] != one) {
					t2++;
				}
			} else {
				if (s[i] != zero) {
					t2++;
				}
			} i % 2 == 0 i % 2 i 2 0 {
				if (s[i] != one) {
					t2++;
				}
			} if (s[i] != one) {
					t2++;
				} s[i] != one s[i] s i one {
					t2++;
				} t2++ t2 {
				if (s[i] != zero) {
					t2++;
				}
			} if (s[i] != zero) {
					t2++;
				} s[i] != zero s[i] s i zero {
					t2++;
				} t2++ t2 System.out.println(Math.min(t1, t2)) System.out.println System.out System System.out Math.min(t1, t2) Math.min Math t1 t2 String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] s = sc.next().toCharArray();
		int n = s.length;
		char zero = '0';
		char one = '1';
		// 0101...
		int t1 = 0;
		for (int i = 0; i < n; i++) {
			if (i % 2 == 0) {
				if (s[i] != zero) {
					t1++;
				}
			} else {
				if (s[i] != one) {
					t1++;
				}
			}
		}
		int t2 = 0;
		for (int i = 0; i < n; i++) {
			if (i % 2 == 0) {
				if (s[i] != one) {
					t2++;
				}
			} else {
				if (s[i] != zero) {
					t2++;
				}
			}
		}
		System.out.println(Math.min(t1, t2));
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] s = sc.next().toCharArray();
		int n = s.length;
		char zero = '0';
		char one = '1';
		// 0101...
		int t1 = 0;
		for (int i = 0; i < n; i++) {
			if (i % 2 == 0) {
				if (s[i] != zero) {
					t1++;
				}
			} else {
				if (s[i] != one) {
					t1++;
				}
			}
		}
		int t2 = 0;
		for (int i = 0; i < n; i++) {
			if (i % 2 == 0) {
				if (s[i] != one) {
					t2++;
				}
			} else {
				if (s[i] != zero) {
					t2++;
				}
			}
		}
		System.out.println(Math.min(t1, t2));
	}
} Main
import java.util.*;
 
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] s = sc.next().toCharArray();
		int n = s.length;
		char zero = '0';
		char one = '1';
		// 0101...
		int t1 = 0;
		for (int i = 0; i < n; i++) {
			if (i % 2 == 0) {
				if (s[i] != zero) {
					t1++;
				}
			} else {
				if (s[i] != one) {
					t1++;
				}
			}
		}
		int t2 = 0;
		for (int i = 0; i < n; i++) {
			if (i % 2 == 0) {
				if (s[i] != one) {
					t2++;
				}
			} else {
				if (s[i] != zero) {
					t2++;
				}
			}
		}
		System.out.println(Math.min(t1, t2));
	}
}

 
 

 
 
 
 
