import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		StringBuffer sb = new StringBuffer();
		for (int i=0;i<s.length();i++) {
			if (i%2==0) {
				sb.append('0');
			} else {
				sb.append('1');
			}
		}
		String zero = sb.toString();
		sb = new StringBuffer();
		for (int i=0;i<s.length();i++) {
			if (i%2==1) {
				sb.append('0');
			} else {
				sb.append('1');
			}
		}
		String one = sb.toString();
		int z =0;
		int o=0;
		for (int i=0;i<s.length();i++) {
			if (s.charAt(i)==zero.charAt(i)) {
				z++;
			} else {
				o++;
			}
		}
		System.out.println(Math.min(z, o));
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		StringBuffer sb = new StringBuffer();
		for (int i=0;i<s.length();i++) {
			if (i%2==0) {
				sb.append('0');
			} else {
				sb.append('1');
			}
		}
		String zero = sb.toString();
		sb = new StringBuffer();
		for (int i=0;i<s.length();i++) {
			if (i%2==1) {
				sb.append('0');
			} else {
				sb.append('1');
			}
		}
		String one = sb.toString();
		int z =0;
		int o=0;
		for (int i=0;i<s.length();i++) {
			if (s.charAt(i)==zero.charAt(i)) {
				z++;
			} else {
				o++;
			}
		}
		System.out.println(Math.min(z, o));
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		StringBuffer sb = new StringBuffer();
		for (int i=0;i<s.length();i++) {
			if (i%2==0) {
				sb.append('0');
			} else {
				sb.append('1');
			}
		}
		String zero = sb.toString();
		sb = new StringBuffer();
		for (int i=0;i<s.length();i++) {
			if (i%2==1) {
				sb.append('0');
			} else {
				sb.append('1');
			}
		}
		String one = sb.toString();
		int z =0;
		int o=0;
		for (int i=0;i<s.length();i++) {
			if (s.charAt(i)==zero.charAt(i)) {
				z++;
			} else {
				o++;
			}
		}
		System.out.println(Math.min(z, o));
	} main {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		StringBuffer sb = new StringBuffer();
		for (int i=0;i<s.length();i++) {
			if (i%2==0) {
				sb.append('0');
			} else {
				sb.append('1');
			}
		}
		String zero = sb.toString();
		sb = new StringBuffer();
		for (int i=0;i<s.length();i++) {
			if (i%2==1) {
				sb.append('0');
			} else {
				sb.append('1');
			}
		}
		String one = sb.toString();
		int z =0;
		int o=0;
		for (int i=0;i<s.length();i++) {
			if (s.charAt(i)==zero.charAt(i)) {
				z++;
			} else {
				o++;
			}
		}
		System.out.println(Math.min(z, o));
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc StringBuffer sb = new StringBuffer(); sb new StringBuffer() for (int i=0;i<s.length();i++) {
			if (i%2==0) {
				sb.append('0');
			} else {
				sb.append('1');
			}
		} int i=0; int i=0; i 0 i<s.length() i s.length() s.length s i++ i++ i {
			if (i%2==0) {
				sb.append('0');
			} else {
				sb.append('1');
			}
		} {
			if (i%2==0) {
				sb.append('0');
			} else {
				sb.append('1');
			}
		} if (i%2==0) {
				sb.append('0');
			} else {
				sb.append('1');
			} i%2==0 i%2 i 2 0 {
				sb.append('0');
			} sb.append('0') sb.append sb '0' {
				sb.append('1');
			} sb.append('1') sb.append sb '1' String zero = sb.toString(); zero sb.toString() sb.toString sb sb = new StringBuffer() sb new StringBuffer() for (int i=0;i<s.length();i++) {
			if (i%2==1) {
				sb.append('0');
			} else {
				sb.append('1');
			}
		} int i=0; int i=0; i 0 i<s.length() i s.length() s.length s i++ i++ i {
			if (i%2==1) {
				sb.append('0');
			} else {
				sb.append('1');
			}
		} {
			if (i%2==1) {
				sb.append('0');
			} else {
				sb.append('1');
			}
		} if (i%2==1) {
				sb.append('0');
			} else {
				sb.append('1');
			} i%2==1 i%2 i 2 1 {
				sb.append('0');
			} sb.append('0') sb.append sb '0' {
				sb.append('1');
			} sb.append('1') sb.append sb '1' String one = sb.toString(); one sb.toString() sb.toString sb int z =0; z 0 int o=0; o 0 for (int i=0;i<s.length();i++) {
			if (s.charAt(i)==zero.charAt(i)) {
				z++;
			} else {
				o++;
			}
		} int i=0; int i=0; i 0 i<s.length() i s.length() s.length s i++ i++ i {
			if (s.charAt(i)==zero.charAt(i)) {
				z++;
			} else {
				o++;
			}
		} {
			if (s.charAt(i)==zero.charAt(i)) {
				z++;
			} else {
				o++;
			}
		} if (s.charAt(i)==zero.charAt(i)) {
				z++;
			} else {
				o++;
			} s.charAt(i)==zero.charAt(i) s.charAt(i) s.charAt s i zero.charAt(i) zero.charAt zero i {
				z++;
			} z++ z {
				o++;
			} o++ o System.out.println(Math.min(z, o)) System.out.println System.out System System.out Math.min(z, o) Math.min Math z o String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		StringBuffer sb = new StringBuffer();
		for (int i=0;i<s.length();i++) {
			if (i%2==0) {
				sb.append('0');
			} else {
				sb.append('1');
			}
		}
		String zero = sb.toString();
		sb = new StringBuffer();
		for (int i=0;i<s.length();i++) {
			if (i%2==1) {
				sb.append('0');
			} else {
				sb.append('1');
			}
		}
		String one = sb.toString();
		int z =0;
		int o=0;
		for (int i=0;i<s.length();i++) {
			if (s.charAt(i)==zero.charAt(i)) {
				z++;
			} else {
				o++;
			}
		}
		System.out.println(Math.min(z, o));
	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		StringBuffer sb = new StringBuffer();
		for (int i=0;i<s.length();i++) {
			if (i%2==0) {
				sb.append('0');
			} else {
				sb.append('1');
			}
		}
		String zero = sb.toString();
		sb = new StringBuffer();
		for (int i=0;i<s.length();i++) {
			if (i%2==1) {
				sb.append('0');
			} else {
				sb.append('1');
			}
		}
		String one = sb.toString();
		int z =0;
		int o=0;
		for (int i=0;i<s.length();i++) {
			if (s.charAt(i)==zero.charAt(i)) {
				z++;
			} else {
				o++;
			}
		}
		System.out.println(Math.min(z, o));
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		StringBuffer sb = new StringBuffer();
		for (int i=0;i<s.length();i++) {
			if (i%2==0) {
				sb.append('0');
			} else {
				sb.append('1');
			}
		}
		String zero = sb.toString();
		sb = new StringBuffer();
		for (int i=0;i<s.length();i++) {
			if (i%2==1) {
				sb.append('0');
			} else {
				sb.append('1');
			}
		}
		String one = sb.toString();
		int z =0;
		int o=0;
		for (int i=0;i<s.length();i++) {
			if (s.charAt(i)==zero.charAt(i)) {
				z++;
			} else {
				o++;
			}
		}
		System.out.println(Math.min(z, o));
	}
}