import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String st = sc.next();
		String[] s = st.split("");
		int count01 = 0; int  count10 = 0; boolean sw = true;
		for(String a: s) {
			if(sw) {
				if(a.equals("0"))count01++;
				if(a.equals("1"))count10++;
			}else {
				if(a.equals("1"))count01++;
				if(a.equals("0"))count10++;
			}
			sw = !sw;
		}
		System.out.println(Math.min(count01,count10));

		sc.close();
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String st = sc.next();
		String[] s = st.split("");
		int count01 = 0; int  count10 = 0; boolean sw = true;
		for(String a: s) {
			if(sw) {
				if(a.equals("0"))count01++;
				if(a.equals("1"))count10++;
			}else {
				if(a.equals("1"))count01++;
				if(a.equals("0"))count10++;
			}
			sw = !sw;
		}
		System.out.println(Math.min(count01,count10));

		sc.close();
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String st = sc.next();
		String[] s = st.split("");
		int count01 = 0; int  count10 = 0; boolean sw = true;
		for(String a: s) {
			if(sw) {
				if(a.equals("0"))count01++;
				if(a.equals("1"))count10++;
			}else {
				if(a.equals("1"))count01++;
				if(a.equals("0"))count10++;
			}
			sw = !sw;
		}
		System.out.println(Math.min(count01,count10));

		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);
		String st = sc.next();
		String[] s = st.split("");
		int count01 = 0; int  count10 = 0; boolean sw = true;
		for(String a: s) {
			if(sw) {
				if(a.equals("0"))count01++;
				if(a.equals("1"))count10++;
			}else {
				if(a.equals("1"))count01++;
				if(a.equals("0"))count10++;
			}
			sw = !sw;
		}
		System.out.println(Math.min(count01,count10));

		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String st = sc.next(); st sc.next() sc.next sc String[] s = st.split(""); s st.split("") st.split st "" int count01 = 0; count01 0 int  count10 = 0; count10 0 boolean sw = true; sw true for(String a: s) {
			if(sw) {
				if(a.equals("0"))count01++;
				if(a.equals("1"))count10++;
			}else {
				if(a.equals("1"))count01++;
				if(a.equals("0"))count10++;
			}
			sw = !sw;
		} String a s {
			if(sw) {
				if(a.equals("0"))count01++;
				if(a.equals("1"))count10++;
			}else {
				if(a.equals("1"))count01++;
				if(a.equals("0"))count10++;
			}
			sw = !sw;
		} {
			if(sw) {
				if(a.equals("0"))count01++;
				if(a.equals("1"))count10++;
			}else {
				if(a.equals("1"))count01++;
				if(a.equals("0"))count10++;
			}
			sw = !sw;
		} if(sw) {
				if(a.equals("0"))count01++;
				if(a.equals("1"))count10++;
			}else {
				if(a.equals("1"))count01++;
				if(a.equals("0"))count10++;
			} sw {
				if(a.equals("0"))count01++;
				if(a.equals("1"))count10++;
			} if(a.equals("0"))count01++; a.equals("0") a.equals a "0" count01++ count01 if(a.equals("1"))count10++; a.equals("1") a.equals a "1" count10++ count10 {
				if(a.equals("1"))count01++;
				if(a.equals("0"))count10++;
			} if(a.equals("1"))count01++; a.equals("1") a.equals a "1" count01++ count01 if(a.equals("0"))count10++; a.equals("0") a.equals a "0" count10++ count10 sw = !sw sw !sw sw System.out.println(Math.min(count01,count10)) System.out.println System.out System System.out Math.min(count01,count10) Math.min Math count01 count10 sc.close() sc.close sc String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String st = sc.next();
		String[] s = st.split("");
		int count01 = 0; int  count10 = 0; boolean sw = true;
		for(String a: s) {
			if(sw) {
				if(a.equals("0"))count01++;
				if(a.equals("1"))count10++;
			}else {
				if(a.equals("1"))count01++;
				if(a.equals("0"))count10++;
			}
			sw = !sw;
		}
		System.out.println(Math.min(count01,count10));

		sc.close();
	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String st = sc.next();
		String[] s = st.split("");
		int count01 = 0; int  count10 = 0; boolean sw = true;
		for(String a: s) {
			if(sw) {
				if(a.equals("0"))count01++;
				if(a.equals("1"))count10++;
			}else {
				if(a.equals("1"))count01++;
				if(a.equals("0"))count10++;
			}
			sw = !sw;
		}
		System.out.println(Math.min(count01,count10));

		sc.close();
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String st = sc.next();
		String[] s = st.split("");
		int count01 = 0; int  count10 = 0; boolean sw = true;
		for(String a: s) {
			if(sw) {
				if(a.equals("0"))count01++;
				if(a.equals("1"))count10++;
			}else {
				if(a.equals("1"))count01++;
				if(a.equals("0"))count10++;
			}
			sw = !sw;
		}
		System.out.println(Math.min(count01,count10));

		sc.close();
	}
}