import java.util.Scanner;

public class Main {

	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		String origin = sc.next();
		char[] oArray = origin.toCharArray();
		char[] wArray = new char[oArray.length];
		char[] bArray = new char[oArray.length];
			for(int i=0;i<oArray.length;i++) {
				if(i%2==0) {
					wArray[i]='0';
				}else {
					wArray[i]='1';
				}
			}
			for(int i=0;i<oArray.length;i++) {
				if(i%2==0) {
					bArray[i]='1';
				}else {
					bArray[i]='0';
				}
			}
		int wcount=0;
		int bcount=0;
		for(int i=0;i<oArray.length;i++) {
			if(oArray[i]!=wArray[i]) wcount++;
			if(oArray[i]!=bArray[i])bcount++;
		}
		System.out.println(Math.min(wcount,bcount));
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		String origin = sc.next();
		char[] oArray = origin.toCharArray();
		char[] wArray = new char[oArray.length];
		char[] bArray = new char[oArray.length];
			for(int i=0;i<oArray.length;i++) {
				if(i%2==0) {
					wArray[i]='0';
				}else {
					wArray[i]='1';
				}
			}
			for(int i=0;i<oArray.length;i++) {
				if(i%2==0) {
					bArray[i]='1';
				}else {
					bArray[i]='0';
				}
			}
		int wcount=0;
		int bcount=0;
		for(int i=0;i<oArray.length;i++) {
			if(oArray[i]!=wArray[i]) wcount++;
			if(oArray[i]!=bArray[i])bcount++;
		}
		System.out.println(Math.min(wcount,bcount));
	}
} Main public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		String origin = sc.next();
		char[] oArray = origin.toCharArray();
		char[] wArray = new char[oArray.length];
		char[] bArray = new char[oArray.length];
			for(int i=0;i<oArray.length;i++) {
				if(i%2==0) {
					wArray[i]='0';
				}else {
					wArray[i]='1';
				}
			}
			for(int i=0;i<oArray.length;i++) {
				if(i%2==0) {
					bArray[i]='1';
				}else {
					bArray[i]='0';
				}
			}
		int wcount=0;
		int bcount=0;
		for(int i=0;i<oArray.length;i++) {
			if(oArray[i]!=wArray[i]) wcount++;
			if(oArray[i]!=bArray[i])bcount++;
		}
		System.out.println(Math.min(wcount,bcount));
	} main {
		Scanner sc = new Scanner(System.in);
		String origin = sc.next();
		char[] oArray = origin.toCharArray();
		char[] wArray = new char[oArray.length];
		char[] bArray = new char[oArray.length];
			for(int i=0;i<oArray.length;i++) {
				if(i%2==0) {
					wArray[i]='0';
				}else {
					wArray[i]='1';
				}
			}
			for(int i=0;i<oArray.length;i++) {
				if(i%2==0) {
					bArray[i]='1';
				}else {
					bArray[i]='0';
				}
			}
		int wcount=0;
		int bcount=0;
		for(int i=0;i<oArray.length;i++) {
			if(oArray[i]!=wArray[i]) wcount++;
			if(oArray[i]!=bArray[i])bcount++;
		}
		System.out.println(Math.min(wcount,bcount));
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String origin = sc.next(); origin sc.next() sc.next sc char[] oArray = origin.toCharArray(); oArray origin.toCharArray() origin.toCharArray origin char[] wArray = new char[oArray.length]; wArray new char[oArray.length] oArray.length oArray oArray.length char[] bArray = new char[oArray.length]; bArray new char[oArray.length] oArray.length oArray oArray.length for(int i=0;i<oArray.length;i++) {
				if(i%2==0) {
					wArray[i]='0';
				}else {
					wArray[i]='1';
				}
			} int i=0; int i=0; i 0 i<oArray.length i oArray.length oArray oArray.length i++ i++ i {
				if(i%2==0) {
					wArray[i]='0';
				}else {
					wArray[i]='1';
				}
			} {
				if(i%2==0) {
					wArray[i]='0';
				}else {
					wArray[i]='1';
				}
			} if(i%2==0) {
					wArray[i]='0';
				}else {
					wArray[i]='1';
				} i%2==0 i%2 i 2 0 {
					wArray[i]='0';
				} wArray[i]='0' wArray[i] wArray i '0' {
					wArray[i]='1';
				} wArray[i]='1' wArray[i] wArray i '1' for(int i=0;i<oArray.length;i++) {
				if(i%2==0) {
					bArray[i]='1';
				}else {
					bArray[i]='0';
				}
			} int i=0; int i=0; i 0 i<oArray.length i oArray.length oArray oArray.length i++ i++ i {
				if(i%2==0) {
					bArray[i]='1';
				}else {
					bArray[i]='0';
				}
			} {
				if(i%2==0) {
					bArray[i]='1';
				}else {
					bArray[i]='0';
				}
			} if(i%2==0) {
					bArray[i]='1';
				}else {
					bArray[i]='0';
				} i%2==0 i%2 i 2 0 {
					bArray[i]='1';
				} bArray[i]='1' bArray[i] bArray i '1' {
					bArray[i]='0';
				} bArray[i]='0' bArray[i] bArray i '0' int wcount=0; wcount 0 int bcount=0; bcount 0 for(int i=0;i<oArray.length;i++) {
			if(oArray[i]!=wArray[i]) wcount++;
			if(oArray[i]!=bArray[i])bcount++;
		} int i=0; int i=0; i 0 i<oArray.length i oArray.length oArray oArray.length i++ i++ i {
			if(oArray[i]!=wArray[i]) wcount++;
			if(oArray[i]!=bArray[i])bcount++;
		} {
			if(oArray[i]!=wArray[i]) wcount++;
			if(oArray[i]!=bArray[i])bcount++;
		} if(oArray[i]!=wArray[i]) wcount++; oArray[i]!=wArray[i] oArray[i] oArray i wArray[i] wArray i wcount++ wcount if(oArray[i]!=bArray[i])bcount++; oArray[i]!=bArray[i] oArray[i] oArray i bArray[i] bArray i bcount++ bcount System.out.println(Math.min(wcount,bcount)) System.out.println System.out System System.out Math.min(wcount,bcount) Math.min Math wcount bcount String args[] args public class Main {

	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		String origin = sc.next();
		char[] oArray = origin.toCharArray();
		char[] wArray = new char[oArray.length];
		char[] bArray = new char[oArray.length];
			for(int i=0;i<oArray.length;i++) {
				if(i%2==0) {
					wArray[i]='0';
				}else {
					wArray[i]='1';
				}
			}
			for(int i=0;i<oArray.length;i++) {
				if(i%2==0) {
					bArray[i]='1';
				}else {
					bArray[i]='0';
				}
			}
		int wcount=0;
		int bcount=0;
		for(int i=0;i<oArray.length;i++) {
			if(oArray[i]!=wArray[i]) wcount++;
			if(oArray[i]!=bArray[i])bcount++;
		}
		System.out.println(Math.min(wcount,bcount));
	}
} public class Main {

	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		String origin = sc.next();
		char[] oArray = origin.toCharArray();
		char[] wArray = new char[oArray.length];
		char[] bArray = new char[oArray.length];
			for(int i=0;i<oArray.length;i++) {
				if(i%2==0) {
					wArray[i]='0';
				}else {
					wArray[i]='1';
				}
			}
			for(int i=0;i<oArray.length;i++) {
				if(i%2==0) {
					bArray[i]='1';
				}else {
					bArray[i]='0';
				}
			}
		int wcount=0;
		int bcount=0;
		for(int i=0;i<oArray.length;i++) {
			if(oArray[i]!=wArray[i]) wcount++;
			if(oArray[i]!=bArray[i])bcount++;
		}
		System.out.println(Math.min(wcount,bcount));
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		String origin = sc.next();
		char[] oArray = origin.toCharArray();
		char[] wArray = new char[oArray.length];
		char[] bArray = new char[oArray.length];
			for(int i=0;i<oArray.length;i++) {
				if(i%2==0) {
					wArray[i]='0';
				}else {
					wArray[i]='1';
				}
			}
			for(int i=0;i<oArray.length;i++) {
				if(i%2==0) {
					bArray[i]='1';
				}else {
					bArray[i]='0';
				}
			}
		int wcount=0;
		int bcount=0;
		for(int i=0;i<oArray.length;i++) {
			if(oArray[i]!=wArray[i]) wcount++;
			if(oArray[i]!=bArray[i])bcount++;
		}
		System.out.println(Math.min(wcount,bcount));
	}
}
