import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		
		StringBuilder sb1 = new StringBuilder();
		StringBuilder sb2 = new StringBuilder();
		int cnt1 = 0;
		int cnt2 = 0;
		int len = s.length();
		for (int i = 0; i < len; i++) {
			if (i % 2 == 0) {
				if (s.charAt(i) == '0') {
					cnt2++;
				} else {
					cnt1++;
				}
			} else if (i % 2 != 0) {
				if (s.charAt(i) == '0') {
					cnt1++;
				} else {
					cnt2++;
				}
				
			}
		}
		
		int ans = Math.min(cnt1, cnt2);
		System.out.println(ans);

	}
} 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();
		
		StringBuilder sb1 = new StringBuilder();
		StringBuilder sb2 = new StringBuilder();
		int cnt1 = 0;
		int cnt2 = 0;
		int len = s.length();
		for (int i = 0; i < len; i++) {
			if (i % 2 == 0) {
				if (s.charAt(i) == '0') {
					cnt2++;
				} else {
					cnt1++;
				}
			} else if (i % 2 != 0) {
				if (s.charAt(i) == '0') {
					cnt1++;
				} else {
					cnt2++;
				}
				
			}
		}
		
		int ans = Math.min(cnt1, cnt2);
		System.out.println(ans);

	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		
		StringBuilder sb1 = new StringBuilder();
		StringBuilder sb2 = new StringBuilder();
		int cnt1 = 0;
		int cnt2 = 0;
		int len = s.length();
		for (int i = 0; i < len; i++) {
			if (i % 2 == 0) {
				if (s.charAt(i) == '0') {
					cnt2++;
				} else {
					cnt1++;
				}
			} else if (i % 2 != 0) {
				if (s.charAt(i) == '0') {
					cnt1++;
				} else {
					cnt2++;
				}
				
			}
		}
		
		int ans = Math.min(cnt1, cnt2);
		System.out.println(ans);

	} main {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		
		StringBuilder sb1 = new StringBuilder();
		StringBuilder sb2 = new StringBuilder();
		int cnt1 = 0;
		int cnt2 = 0;
		int len = s.length();
		for (int i = 0; i < len; i++) {
			if (i % 2 == 0) {
				if (s.charAt(i) == '0') {
					cnt2++;
				} else {
					cnt1++;
				}
			} else if (i % 2 != 0) {
				if (s.charAt(i) == '0') {
					cnt1++;
				} else {
					cnt2++;
				}
				
			}
		}
		
		int ans = Math.min(cnt1, cnt2);
		System.out.println(ans);

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc StringBuilder sb1 = new StringBuilder(); sb1 new StringBuilder() StringBuilder sb2 = new StringBuilder(); sb2 new StringBuilder() int cnt1 = 0; cnt1 0 int cnt2 = 0; cnt2 0 int len = s.length(); len s.length() s.length s for (int i = 0; i < len; i++) {
			if (i % 2 == 0) {
				if (s.charAt(i) == '0') {
					cnt2++;
				} else {
					cnt1++;
				}
			} else if (i % 2 != 0) {
				if (s.charAt(i) == '0') {
					cnt1++;
				} else {
					cnt2++;
				}
				
			}
		} int i = 0; int i = 0; i 0 i < len i len i++ i++ i {
			if (i % 2 == 0) {
				if (s.charAt(i) == '0') {
					cnt2++;
				} else {
					cnt1++;
				}
			} else if (i % 2 != 0) {
				if (s.charAt(i) == '0') {
					cnt1++;
				} else {
					cnt2++;
				}
				
			}
		} {
			if (i % 2 == 0) {
				if (s.charAt(i) == '0') {
					cnt2++;
				} else {
					cnt1++;
				}
			} else if (i % 2 != 0) {
				if (s.charAt(i) == '0') {
					cnt1++;
				} else {
					cnt2++;
				}
				
			}
		} if (i % 2 == 0) {
				if (s.charAt(i) == '0') {
					cnt2++;
				} else {
					cnt1++;
				}
			} else if (i % 2 != 0) {
				if (s.charAt(i) == '0') {
					cnt1++;
				} else {
					cnt2++;
				}
				
			} i % 2 == 0 i % 2 i 2 0 {
				if (s.charAt(i) == '0') {
					cnt2++;
				} else {
					cnt1++;
				}
			} if (s.charAt(i) == '0') {
					cnt2++;
				} else {
					cnt1++;
				} s.charAt(i) == '0' s.charAt(i) s.charAt s i '0' {
					cnt2++;
				} cnt2++ cnt2 {
					cnt1++;
				} cnt1++ cnt1 if (i % 2 != 0) {
				if (s.charAt(i) == '0') {
					cnt1++;
				} else {
					cnt2++;
				}
				
			} i % 2 != 0 i % 2 i 2 0 {
				if (s.charAt(i) == '0') {
					cnt1++;
				} else {
					cnt2++;
				}
				
			} if (s.charAt(i) == '0') {
					cnt1++;
				} else {
					cnt2++;
				} s.charAt(i) == '0' s.charAt(i) s.charAt s i '0' {
					cnt1++;
				} cnt1++ cnt1 {
					cnt2++;
				} cnt2++ cnt2 int ans = Math.min(cnt1, cnt2); ans Math.min(cnt1, cnt2) Math.min Math cnt1 cnt2 System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		
		StringBuilder sb1 = new StringBuilder();
		StringBuilder sb2 = new StringBuilder();
		int cnt1 = 0;
		int cnt2 = 0;
		int len = s.length();
		for (int i = 0; i < len; i++) {
			if (i % 2 == 0) {
				if (s.charAt(i) == '0') {
					cnt2++;
				} else {
					cnt1++;
				}
			} else if (i % 2 != 0) {
				if (s.charAt(i) == '0') {
					cnt1++;
				} else {
					cnt2++;
				}
				
			}
		}
		
		int ans = Math.min(cnt1, cnt2);
		System.out.println(ans);

	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		
		StringBuilder sb1 = new StringBuilder();
		StringBuilder sb2 = new StringBuilder();
		int cnt1 = 0;
		int cnt2 = 0;
		int len = s.length();
		for (int i = 0; i < len; i++) {
			if (i % 2 == 0) {
				if (s.charAt(i) == '0') {
					cnt2++;
				} else {
					cnt1++;
				}
			} else if (i % 2 != 0) {
				if (s.charAt(i) == '0') {
					cnt1++;
				} else {
					cnt2++;
				}
				
			}
		}
		
		int ans = Math.min(cnt1, cnt2);
		System.out.println(ans);

	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		
		StringBuilder sb1 = new StringBuilder();
		StringBuilder sb2 = new StringBuilder();
		int cnt1 = 0;
		int cnt2 = 0;
		int len = s.length();
		for (int i = 0; i < len; i++) {
			if (i % 2 == 0) {
				if (s.charAt(i) == '0') {
					cnt2++;
				} else {
					cnt1++;
				}
			} else if (i % 2 != 0) {
				if (s.charAt(i) == '0') {
					cnt1++;
				} else {
					cnt2++;
				}
				
			}
		}
		
		int ans = Math.min(cnt1, cnt2);
		System.out.println(ans);

	}
}
