import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String[] s = sc.next().split("");
		if(s.length ==1) {
			System.out.println("0");
			return;
		}
		int answer1 =0;
		int answer2 =0;
		int tile1=0;
		for(int i =0;i <s.length;i++) {
			if(Integer.parseInt(s[i]) !=tile1) {
				answer1++;
			}else {
				answer2++;
			}
			if(tile1 ==0) {
				tile1 =1;
			}else {
				tile1 =0;
			}
		}
		if(answer1 < answer2) {
			System.out.println(answer1);
		}else {
			System.out.println(answer2);
		}
	}
} 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().split("");
		if(s.length ==1) {
			System.out.println("0");
			return;
		}
		int answer1 =0;
		int answer2 =0;
		int tile1=0;
		for(int i =0;i <s.length;i++) {
			if(Integer.parseInt(s[i]) !=tile1) {
				answer1++;
			}else {
				answer2++;
			}
			if(tile1 ==0) {
				tile1 =1;
			}else {
				tile1 =0;
			}
		}
		if(answer1 < answer2) {
			System.out.println(answer1);
		}else {
			System.out.println(answer2);
		}
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String[] s = sc.next().split("");
		if(s.length ==1) {
			System.out.println("0");
			return;
		}
		int answer1 =0;
		int answer2 =0;
		int tile1=0;
		for(int i =0;i <s.length;i++) {
			if(Integer.parseInt(s[i]) !=tile1) {
				answer1++;
			}else {
				answer2++;
			}
			if(tile1 ==0) {
				tile1 =1;
			}else {
				tile1 =0;
			}
		}
		if(answer1 < answer2) {
			System.out.println(answer1);
		}else {
			System.out.println(answer2);
		}
	} main {
		Scanner sc = new Scanner(System.in);
		String[] s = sc.next().split("");
		if(s.length ==1) {
			System.out.println("0");
			return;
		}
		int answer1 =0;
		int answer2 =0;
		int tile1=0;
		for(int i =0;i <s.length;i++) {
			if(Integer.parseInt(s[i]) !=tile1) {
				answer1++;
			}else {
				answer2++;
			}
			if(tile1 ==0) {
				tile1 =1;
			}else {
				tile1 =0;
			}
		}
		if(answer1 < answer2) {
			System.out.println(answer1);
		}else {
			System.out.println(answer2);
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String[] s = sc.next().split(""); s sc.next().split("") sc.next().split sc.next() sc.next sc "" if(s.length ==1) {
			System.out.println("0");
			return;
		} s.length ==1 s.length s s.length 1 {
			System.out.println("0");
			return;
		} System.out.println("0") System.out.println System.out System System.out "0" return; int answer1 =0; answer1 0 int answer2 =0; answer2 0 int tile1=0; tile1 0 for(int i =0;i <s.length;i++) {
			if(Integer.parseInt(s[i]) !=tile1) {
				answer1++;
			}else {
				answer2++;
			}
			if(tile1 ==0) {
				tile1 =1;
			}else {
				tile1 =0;
			}
		} int i =0; int i =0; i 0 i <s.length i s.length s s.length i++ i++ i {
			if(Integer.parseInt(s[i]) !=tile1) {
				answer1++;
			}else {
				answer2++;
			}
			if(tile1 ==0) {
				tile1 =1;
			}else {
				tile1 =0;
			}
		} {
			if(Integer.parseInt(s[i]) !=tile1) {
				answer1++;
			}else {
				answer2++;
			}
			if(tile1 ==0) {
				tile1 =1;
			}else {
				tile1 =0;
			}
		} if(Integer.parseInt(s[i]) !=tile1) {
				answer1++;
			}else {
				answer2++;
			} Integer.parseInt(s[i]) !=tile1 Integer.parseInt(s[i]) Integer.parseInt Integer s[i] s i tile1 {
				answer1++;
			} answer1++ answer1 {
				answer2++;
			} answer2++ answer2 if(tile1 ==0) {
				tile1 =1;
			}else {
				tile1 =0;
			} tile1 ==0 tile1 0 {
				tile1 =1;
			} tile1 =1 tile1 1 {
				tile1 =0;
			} tile1 =0 tile1 0 if(answer1 < answer2) {
			System.out.println(answer1);
		}else {
			System.out.println(answer2);
		} answer1 < answer2 answer1 answer2 {
			System.out.println(answer1);
		} System.out.println(answer1) System.out.println System.out System System.out answer1 {
			System.out.println(answer2);
		} System.out.println(answer2) System.out.println System.out System System.out answer2 String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String[] s = sc.next().split("");
		if(s.length ==1) {
			System.out.println("0");
			return;
		}
		int answer1 =0;
		int answer2 =0;
		int tile1=0;
		for(int i =0;i <s.length;i++) {
			if(Integer.parseInt(s[i]) !=tile1) {
				answer1++;
			}else {
				answer2++;
			}
			if(tile1 ==0) {
				tile1 =1;
			}else {
				tile1 =0;
			}
		}
		if(answer1 < answer2) {
			System.out.println(answer1);
		}else {
			System.out.println(answer2);
		}
	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String[] s = sc.next().split("");
		if(s.length ==1) {
			System.out.println("0");
			return;
		}
		int answer1 =0;
		int answer2 =0;
		int tile1=0;
		for(int i =0;i <s.length;i++) {
			if(Integer.parseInt(s[i]) !=tile1) {
				answer1++;
			}else {
				answer2++;
			}
			if(tile1 ==0) {
				tile1 =1;
			}else {
				tile1 =0;
			}
		}
		if(answer1 < answer2) {
			System.out.println(answer1);
		}else {
			System.out.println(answer2);
		}
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String[] s = sc.next().split("");
		if(s.length ==1) {
			System.out.println("0");
			return;
		}
		int answer1 =0;
		int answer2 =0;
		int tile1=0;
		for(int i =0;i <s.length;i++) {
			if(Integer.parseInt(s[i]) !=tile1) {
				answer1++;
			}else {
				answer2++;
			}
			if(tile1 ==0) {
				tile1 =1;
			}else {
				tile1 =0;
			}
		}
		if(answer1 < answer2) {
			System.out.println(answer1);
		}else {
			System.out.println(answer2);
		}
	}
}