import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		char[] c = s.toCharArray();
		char[] start_black = new char[s.length()];
		char[] start_white = new char[s.length()];
		int bCount = 0;
		int wCount = 0;
		for(int i = 0; i <s.length(); i++) {
			if(i%2==0) {
				start_black[i] = '0';
				start_white[i] = '1';
			}
			else {
				start_black[i] = '1';
				start_white[i] ='0';
			}
		}
		for(int i = 0; i < s.length(); i++) {
			if(c[i] != start_black[i]) {
				bCount++;
			}
			if(c[i] != start_white[i]) {
				wCount++;
			}
		}
		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 s = sc.next();
		char[] c = s.toCharArray();
		char[] start_black = new char[s.length()];
		char[] start_white = new char[s.length()];
		int bCount = 0;
		int wCount = 0;
		for(int i = 0; i <s.length(); i++) {
			if(i%2==0) {
				start_black[i] = '0';
				start_white[i] = '1';
			}
			else {
				start_black[i] = '1';
				start_white[i] ='0';
			}
		}
		for(int i = 0; i < s.length(); i++) {
			if(c[i] != start_black[i]) {
				bCount++;
			}
			if(c[i] != start_white[i]) {
				wCount++;
			}
		}
		System.out.println(Math.min(wCount, bCount));
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		char[] c = s.toCharArray();
		char[] start_black = new char[s.length()];
		char[] start_white = new char[s.length()];
		int bCount = 0;
		int wCount = 0;
		for(int i = 0; i <s.length(); i++) {
			if(i%2==0) {
				start_black[i] = '0';
				start_white[i] = '1';
			}
			else {
				start_black[i] = '1';
				start_white[i] ='0';
			}
		}
		for(int i = 0; i < s.length(); i++) {
			if(c[i] != start_black[i]) {
				bCount++;
			}
			if(c[i] != start_white[i]) {
				wCount++;
			}
		}
		System.out.println(Math.min(wCount, bCount));
	} main {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		char[] c = s.toCharArray();
		char[] start_black = new char[s.length()];
		char[] start_white = new char[s.length()];
		int bCount = 0;
		int wCount = 0;
		for(int i = 0; i <s.length(); i++) {
			if(i%2==0) {
				start_black[i] = '0';
				start_white[i] = '1';
			}
			else {
				start_black[i] = '1';
				start_white[i] ='0';
			}
		}
		for(int i = 0; i < s.length(); i++) {
			if(c[i] != start_black[i]) {
				bCount++;
			}
			if(c[i] != start_white[i]) {
				wCount++;
			}
		}
		System.out.println(Math.min(wCount, bCount));
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc char[] c = s.toCharArray(); c s.toCharArray() s.toCharArray s char[] start_black = new char[s.length()]; start_black new char[s.length()] s.length() s.length s char[] start_white = new char[s.length()]; start_white new char[s.length()] s.length() s.length s int bCount = 0; bCount 0 int wCount = 0; wCount 0 for(int i = 0; i <s.length(); i++) {
			if(i%2==0) {
				start_black[i] = '0';
				start_white[i] = '1';
			}
			else {
				start_black[i] = '1';
				start_white[i] ='0';
			}
		} int i = 0; int i = 0; i 0 i <s.length() i s.length() s.length s i++ i++ i {
			if(i%2==0) {
				start_black[i] = '0';
				start_white[i] = '1';
			}
			else {
				start_black[i] = '1';
				start_white[i] ='0';
			}
		} {
			if(i%2==0) {
				start_black[i] = '0';
				start_white[i] = '1';
			}
			else {
				start_black[i] = '1';
				start_white[i] ='0';
			}
		} if(i%2==0) {
				start_black[i] = '0';
				start_white[i] = '1';
			}
			else {
				start_black[i] = '1';
				start_white[i] ='0';
			} i%2==0 i%2 i 2 0 {
				start_black[i] = '0';
				start_white[i] = '1';
			} start_black[i] = '0' start_black[i] start_black i '0' start_white[i] = '1' start_white[i] start_white i '1' {
				start_black[i] = '1';
				start_white[i] ='0';
			} start_black[i] = '1' start_black[i] start_black i '1' start_white[i] ='0' start_white[i] start_white i '0' for(int i = 0; i < s.length(); i++) {
			if(c[i] != start_black[i]) {
				bCount++;
			}
			if(c[i] != start_white[i]) {
				wCount++;
			}
		} int i = 0; int i = 0; i 0 i < s.length() i s.length() s.length s i++ i++ i {
			if(c[i] != start_black[i]) {
				bCount++;
			}
			if(c[i] != start_white[i]) {
				wCount++;
			}
		} {
			if(c[i] != start_black[i]) {
				bCount++;
			}
			if(c[i] != start_white[i]) {
				wCount++;
			}
		} if(c[i] != start_black[i]) {
				bCount++;
			} c[i] != start_black[i] c[i] c i start_black[i] start_black i {
				bCount++;
			} bCount++ bCount if(c[i] != start_white[i]) {
				wCount++;
			} c[i] != start_white[i] c[i] c i start_white[i] start_white i {
				wCount++;
			} wCount++ wCount 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 s = sc.next();
		char[] c = s.toCharArray();
		char[] start_black = new char[s.length()];
		char[] start_white = new char[s.length()];
		int bCount = 0;
		int wCount = 0;
		for(int i = 0; i <s.length(); i++) {
			if(i%2==0) {
				start_black[i] = '0';
				start_white[i] = '1';
			}
			else {
				start_black[i] = '1';
				start_white[i] ='0';
			}
		}
		for(int i = 0; i < s.length(); i++) {
			if(c[i] != start_black[i]) {
				bCount++;
			}
			if(c[i] != start_white[i]) {
				wCount++;
			}
		}
		System.out.println(Math.min(wCount, bCount));
	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		char[] c = s.toCharArray();
		char[] start_black = new char[s.length()];
		char[] start_white = new char[s.length()];
		int bCount = 0;
		int wCount = 0;
		for(int i = 0; i <s.length(); i++) {
			if(i%2==0) {
				start_black[i] = '0';
				start_white[i] = '1';
			}
			else {
				start_black[i] = '1';
				start_white[i] ='0';
			}
		}
		for(int i = 0; i < s.length(); i++) {
			if(c[i] != start_black[i]) {
				bCount++;
			}
			if(c[i] != start_white[i]) {
				wCount++;
			}
		}
		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 s = sc.next();
		char[] c = s.toCharArray();
		char[] start_black = new char[s.length()];
		char[] start_white = new char[s.length()];
		int bCount = 0;
		int wCount = 0;
		for(int i = 0; i <s.length(); i++) {
			if(i%2==0) {
				start_black[i] = '0';
				start_white[i] = '1';
			}
			else {
				start_black[i] = '1';
				start_white[i] ='0';
			}
		}
		for(int i = 0; i < s.length(); i++) {
			if(c[i] != start_black[i]) {
				bCount++;
			}
			if(c[i] != start_white[i]) {
				wCount++;
			}
		}
		System.out.println(Math.min(wCount, bCount));
	}
}
