
import java.util.*;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int ans = Integer.MAX_VALUE/2;
		int len = s.length();
		//01010101010
		int sum = 0;
		for(int i=0;i<len;i++) {
			if(i%2==0) {
				if(s.charAt(i)=='1')sum++;
			}
			else {
				if(s.charAt(i)=='0')sum++;
			}
		}
		
		ans = Math.min(ans, sum);
		
		//10101010101
		sum = 0;
		for(int i=0;i<len;i++) {
			if(i%2==0) {
				if(s.charAt(i)=='0')sum++;
			}
			else {
				if(s.charAt(i)=='1')sum++;
			}
		}
		ans = Math.min(ans, sum);
		
		System.out.println(ans);
	}
}
 import java.util.*; util.* java public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int ans = Integer.MAX_VALUE/2;
		int len = s.length();
		//01010101010
		int sum = 0;
		for(int i=0;i<len;i++) {
			if(i%2==0) {
				if(s.charAt(i)=='1')sum++;
			}
			else {
				if(s.charAt(i)=='0')sum++;
			}
		}
		
		ans = Math.min(ans, sum);
		
		//10101010101
		sum = 0;
		for(int i=0;i<len;i++) {
			if(i%2==0) {
				if(s.charAt(i)=='0')sum++;
			}
			else {
				if(s.charAt(i)=='1')sum++;
			}
		}
		ans = Math.min(ans, sum);
		
		System.out.println(ans);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int ans = Integer.MAX_VALUE/2;
		int len = s.length();
		//01010101010
		int sum = 0;
		for(int i=0;i<len;i++) {
			if(i%2==0) {
				if(s.charAt(i)=='1')sum++;
			}
			else {
				if(s.charAt(i)=='0')sum++;
			}
		}
		
		ans = Math.min(ans, sum);
		
		//10101010101
		sum = 0;
		for(int i=0;i<len;i++) {
			if(i%2==0) {
				if(s.charAt(i)=='0')sum++;
			}
			else {
				if(s.charAt(i)=='1')sum++;
			}
		}
		ans = Math.min(ans, sum);
		
		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int ans = Integer.MAX_VALUE/2;
		int len = s.length();
		//01010101010
		int sum = 0;
		for(int i=0;i<len;i++) {
			if(i%2==0) {
				if(s.charAt(i)=='1')sum++;
			}
			else {
				if(s.charAt(i)=='0')sum++;
			}
		}
		
		ans = Math.min(ans, sum);
		
		//10101010101
		sum = 0;
		for(int i=0;i<len;i++) {
			if(i%2==0) {
				if(s.charAt(i)=='0')sum++;
			}
			else {
				if(s.charAt(i)=='1')sum++;
			}
		}
		ans = Math.min(ans, sum);
		
		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 int ans = Integer.MAX_VALUE/2; ans Integer.MAX_VALUE/2 Integer.MAX_VALUE Integer Integer.MAX_VALUE 2 int len = s.length(); len s.length() s.length s int sum = 0; sum 0 for(int i=0;i<len;i++) {
			if(i%2==0) {
				if(s.charAt(i)=='1')sum++;
			}
			else {
				if(s.charAt(i)=='0')sum++;
			}
		} int i=0; int i=0; i 0 i<len i len i++ i++ i {
			if(i%2==0) {
				if(s.charAt(i)=='1')sum++;
			}
			else {
				if(s.charAt(i)=='0')sum++;
			}
		} {
			if(i%2==0) {
				if(s.charAt(i)=='1')sum++;
			}
			else {
				if(s.charAt(i)=='0')sum++;
			}
		} if(i%2==0) {
				if(s.charAt(i)=='1')sum++;
			}
			else {
				if(s.charAt(i)=='0')sum++;
			} i%2==0 i%2 i 2 0 {
				if(s.charAt(i)=='1')sum++;
			} if(s.charAt(i)=='1')sum++; s.charAt(i)=='1' s.charAt(i) s.charAt s i '1' sum++ sum {
				if(s.charAt(i)=='0')sum++;
			} if(s.charAt(i)=='0')sum++; s.charAt(i)=='0' s.charAt(i) s.charAt s i '0' sum++ sum ans = Math.min(ans, sum) ans Math.min(ans, sum) Math.min Math ans sum sum = 0 sum 0 for(int i=0;i<len;i++) {
			if(i%2==0) {
				if(s.charAt(i)=='0')sum++;
			}
			else {
				if(s.charAt(i)=='1')sum++;
			}
		} int i=0; int i=0; i 0 i<len i len i++ i++ i {
			if(i%2==0) {
				if(s.charAt(i)=='0')sum++;
			}
			else {
				if(s.charAt(i)=='1')sum++;
			}
		} {
			if(i%2==0) {
				if(s.charAt(i)=='0')sum++;
			}
			else {
				if(s.charAt(i)=='1')sum++;
			}
		} if(i%2==0) {
				if(s.charAt(i)=='0')sum++;
			}
			else {
				if(s.charAt(i)=='1')sum++;
			} i%2==0 i%2 i 2 0 {
				if(s.charAt(i)=='0')sum++;
			} if(s.charAt(i)=='0')sum++; s.charAt(i)=='0' s.charAt(i) s.charAt s i '0' sum++ sum {
				if(s.charAt(i)=='1')sum++;
			} if(s.charAt(i)=='1')sum++; s.charAt(i)=='1' s.charAt(i) s.charAt s i '1' sum++ sum ans = Math.min(ans, sum) ans Math.min(ans, sum) Math.min Math ans sum 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();
		int ans = Integer.MAX_VALUE/2;
		int len = s.length();
		//01010101010
		int sum = 0;
		for(int i=0;i<len;i++) {
			if(i%2==0) {
				if(s.charAt(i)=='1')sum++;
			}
			else {
				if(s.charAt(i)=='0')sum++;
			}
		}
		
		ans = Math.min(ans, sum);
		
		//10101010101
		sum = 0;
		for(int i=0;i<len;i++) {
			if(i%2==0) {
				if(s.charAt(i)=='0')sum++;
			}
			else {
				if(s.charAt(i)=='1')sum++;
			}
		}
		ans = Math.min(ans, sum);
		
		System.out.println(ans);
	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int ans = Integer.MAX_VALUE/2;
		int len = s.length();
		//01010101010
		int sum = 0;
		for(int i=0;i<len;i++) {
			if(i%2==0) {
				if(s.charAt(i)=='1')sum++;
			}
			else {
				if(s.charAt(i)=='0')sum++;
			}
		}
		
		ans = Math.min(ans, sum);
		
		//10101010101
		sum = 0;
		for(int i=0;i<len;i++) {
			if(i%2==0) {
				if(s.charAt(i)=='0')sum++;
			}
			else {
				if(s.charAt(i)=='1')sum++;
			}
		}
		ans = Math.min(ans, sum);
		
		System.out.println(ans);
	}
} Main

import java.util.*;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int ans = Integer.MAX_VALUE/2;
		int len = s.length();
		//01010101010
		int sum = 0;
		for(int i=0;i<len;i++) {
			if(i%2==0) {
				if(s.charAt(i)=='1')sum++;
			}
			else {
				if(s.charAt(i)=='0')sum++;
			}
		}
		
		ans = Math.min(ans, sum);
		
		//10101010101
		sum = 0;
		for(int i=0;i<len;i++) {
			if(i%2==0) {
				if(s.charAt(i)=='0')sum++;
			}
			else {
				if(s.charAt(i)=='1')sum++;
			}
		}
		ans = Math.min(ans, sum);
		
		System.out.println(ans);
	}
}

