import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		char[] s = sc.next().toCharArray();
		int len = s.length;
		char[] c1 = new char[len];
		char[] c2 = new char[len];
		for (int i = 0; i < len; i = i + 2) {
			c1[i] = '0';
			c2[i] = '1';
		}
		for (int i = 1; i < len; i = i + 2) {
			c1[i] = '1';
			c2[i] = '0';
		}
		int dif1 = 0, dif2 = 0;
		for (int i = 0; i < len; i++) {
			if (s[i] != c1[i]) {
				dif1++;
			}
			if (s[i] != c2[i]) {
				dif2++;
			}
		}
		System.out.println(Math.min(dif1, dif2));
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		char[] s = sc.next().toCharArray();
		int len = s.length;
		char[] c1 = new char[len];
		char[] c2 = new char[len];
		for (int i = 0; i < len; i = i + 2) {
			c1[i] = '0';
			c2[i] = '1';
		}
		for (int i = 1; i < len; i = i + 2) {
			c1[i] = '1';
			c2[i] = '0';
		}
		int dif1 = 0, dif2 = 0;
		for (int i = 0; i < len; i++) {
			if (s[i] != c1[i]) {
				dif1++;
			}
			if (s[i] != c2[i]) {
				dif2++;
			}
		}
		System.out.println(Math.min(dif1, dif2));
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		char[] s = sc.next().toCharArray();
		int len = s.length;
		char[] c1 = new char[len];
		char[] c2 = new char[len];
		for (int i = 0; i < len; i = i + 2) {
			c1[i] = '0';
			c2[i] = '1';
		}
		for (int i = 1; i < len; i = i + 2) {
			c1[i] = '1';
			c2[i] = '0';
		}
		int dif1 = 0, dif2 = 0;
		for (int i = 0; i < len; i++) {
			if (s[i] != c1[i]) {
				dif1++;
			}
			if (s[i] != c2[i]) {
				dif2++;
			}
		}
		System.out.println(Math.min(dif1, dif2));
	} main {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		char[] s = sc.next().toCharArray();
		int len = s.length;
		char[] c1 = new char[len];
		char[] c2 = new char[len];
		for (int i = 0; i < len; i = i + 2) {
			c1[i] = '0';
			c2[i] = '1';
		}
		for (int i = 1; i < len; i = i + 2) {
			c1[i] = '1';
			c2[i] = '0';
		}
		int dif1 = 0, dif2 = 0;
		for (int i = 0; i < len; i++) {
			if (s[i] != c1[i]) {
				dif1++;
			}
			if (s[i] != c2[i]) {
				dif2++;
			}
		}
		System.out.println(Math.min(dif1, dif2));
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) StringBuilder sb = new StringBuilder(); sb new StringBuilder() char[] s = sc.next().toCharArray(); s sc.next().toCharArray() sc.next().toCharArray sc.next() sc.next sc int len = s.length; len s.length s s.length char[] c1 = new char[len]; c1 new char[len] len char[] c2 = new char[len]; c2 new char[len] len for (int i = 0; i < len; i = i + 2) {
			c1[i] = '0';
			c2[i] = '1';
		} int i = 0; int i = 0; i 0 i < len i len i = i + 2 i = i + 2 i i + 2 i 2 {
			c1[i] = '0';
			c2[i] = '1';
		} {
			c1[i] = '0';
			c2[i] = '1';
		} c1[i] = '0' c1[i] c1 i '0' c2[i] = '1' c2[i] c2 i '1' for (int i = 1; i < len; i = i + 2) {
			c1[i] = '1';
			c2[i] = '0';
		} int i = 1; int i = 1; i 1 i < len i len i = i + 2 i = i + 2 i i + 2 i 2 {
			c1[i] = '1';
			c2[i] = '0';
		} {
			c1[i] = '1';
			c2[i] = '0';
		} c1[i] = '1' c1[i] c1 i '1' c2[i] = '0' c2[i] c2 i '0' int dif1 = 0 dif1 0 dif2 = 0; dif2 0 for (int i = 0; i < len; i++) {
			if (s[i] != c1[i]) {
				dif1++;
			}
			if (s[i] != c2[i]) {
				dif2++;
			}
		} int i = 0; int i = 0; i 0 i < len i len i++ i++ i {
			if (s[i] != c1[i]) {
				dif1++;
			}
			if (s[i] != c2[i]) {
				dif2++;
			}
		} {
			if (s[i] != c1[i]) {
				dif1++;
			}
			if (s[i] != c2[i]) {
				dif2++;
			}
		} if (s[i] != c1[i]) {
				dif1++;
			} s[i] != c1[i] s[i] s i c1[i] c1 i {
				dif1++;
			} dif1++ dif1 if (s[i] != c2[i]) {
				dif2++;
			} s[i] != c2[i] s[i] s i c2[i] c2 i {
				dif2++;
			} dif2++ dif2 System.out.println(Math.min(dif1, dif2)) System.out.println System.out System System.out Math.min(dif1, dif2) Math.min Math dif1 dif2 String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		char[] s = sc.next().toCharArray();
		int len = s.length;
		char[] c1 = new char[len];
		char[] c2 = new char[len];
		for (int i = 0; i < len; i = i + 2) {
			c1[i] = '0';
			c2[i] = '1';
		}
		for (int i = 1; i < len; i = i + 2) {
			c1[i] = '1';
			c2[i] = '0';
		}
		int dif1 = 0, dif2 = 0;
		for (int i = 0; i < len; i++) {
			if (s[i] != c1[i]) {
				dif1++;
			}
			if (s[i] != c2[i]) {
				dif2++;
			}
		}
		System.out.println(Math.min(dif1, dif2));
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		char[] s = sc.next().toCharArray();
		int len = s.length;
		char[] c1 = new char[len];
		char[] c2 = new char[len];
		for (int i = 0; i < len; i = i + 2) {
			c1[i] = '0';
			c2[i] = '1';
		}
		for (int i = 1; i < len; i = i + 2) {
			c1[i] = '1';
			c2[i] = '0';
		}
		int dif1 = 0, dif2 = 0;
		for (int i = 0; i < len; i++) {
			if (s[i] != c1[i]) {
				dif1++;
			}
			if (s[i] != c2[i]) {
				dif2++;
			}
		}
		System.out.println(Math.min(dif1, dif2));
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		char[] s = sc.next().toCharArray();
		int len = s.length;
		char[] c1 = new char[len];
		char[] c2 = new char[len];
		for (int i = 0; i < len; i = i + 2) {
			c1[i] = '0';
			c2[i] = '1';
		}
		for (int i = 1; i < len; i = i + 2) {
			c1[i] = '1';
			c2[i] = '0';
		}
		int dif1 = 0, dif2 = 0;
		for (int i = 0; i < len; i++) {
			if (s[i] != c1[i]) {
				dif1++;
			}
			if (s[i] != c2[i]) {
				dif2++;
			}
		}
		System.out.println(Math.min(dif1, dif2));
	}
}
