import java.util.*;

class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();
		char[] inputs = line.toCharArray();
		int ans = inputs.length;

		int cnt = 0;
		for(int i = 0; i < inputs.length; i++) {
			if(i%2 == 0 && inputs[i] == '1')cnt++;
			if(i%2 == 1 && inputs[i] == '0')cnt++;
		}
		ans = ans < cnt ? ans : cnt;
		
		cnt = 0;
		for(int i = 0; i < inputs.length; i++) {
			if(i%2 == 0 && inputs[i] == '0')cnt++;
			if(i%2 == 1 && inputs[i] == '1')cnt++;
		}
		ans = ans < cnt ? ans : cnt;

		System.out.println(ans);
	}
}

 import java.util.*; util.* java class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();
		char[] inputs = line.toCharArray();
		int ans = inputs.length;

		int cnt = 0;
		for(int i = 0; i < inputs.length; i++) {
			if(i%2 == 0 && inputs[i] == '1')cnt++;
			if(i%2 == 1 && inputs[i] == '0')cnt++;
		}
		ans = ans < cnt ? ans : cnt;
		
		cnt = 0;
		for(int i = 0; i < inputs.length; i++) {
			if(i%2 == 0 && inputs[i] == '0')cnt++;
			if(i%2 == 1 && inputs[i] == '1')cnt++;
		}
		ans = ans < cnt ? ans : cnt;

		System.out.println(ans);
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();
		char[] inputs = line.toCharArray();
		int ans = inputs.length;

		int cnt = 0;
		for(int i = 0; i < inputs.length; i++) {
			if(i%2 == 0 && inputs[i] == '1')cnt++;
			if(i%2 == 1 && inputs[i] == '0')cnt++;
		}
		ans = ans < cnt ? ans : cnt;
		
		cnt = 0;
		for(int i = 0; i < inputs.length; i++) {
			if(i%2 == 0 && inputs[i] == '0')cnt++;
			if(i%2 == 1 && inputs[i] == '1')cnt++;
		}
		ans = ans < cnt ? ans : cnt;

		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();
		char[] inputs = line.toCharArray();
		int ans = inputs.length;

		int cnt = 0;
		for(int i = 0; i < inputs.length; i++) {
			if(i%2 == 0 && inputs[i] == '1')cnt++;
			if(i%2 == 1 && inputs[i] == '0')cnt++;
		}
		ans = ans < cnt ? ans : cnt;
		
		cnt = 0;
		for(int i = 0; i < inputs.length; i++) {
			if(i%2 == 0 && inputs[i] == '0')cnt++;
			if(i%2 == 1 && inputs[i] == '1')cnt++;
		}
		ans = ans < cnt ? ans : cnt;

		System.out.println(ans);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String line = sc.nextLine(); line sc.nextLine() sc.nextLine sc char[] inputs = line.toCharArray(); inputs line.toCharArray() line.toCharArray line int ans = inputs.length; ans inputs.length inputs inputs.length int cnt = 0; cnt 0 for(int i = 0; i < inputs.length; i++) {
			if(i%2 == 0 && inputs[i] == '1')cnt++;
			if(i%2 == 1 && inputs[i] == '0')cnt++;
		} int i = 0; int i = 0; i 0 i < inputs.length i inputs.length inputs inputs.length i++ i++ i {
			if(i%2 == 0 && inputs[i] == '1')cnt++;
			if(i%2 == 1 && inputs[i] == '0')cnt++;
		} {
			if(i%2 == 0 && inputs[i] == '1')cnt++;
			if(i%2 == 1 && inputs[i] == '0')cnt++;
		} if(i%2 == 0 && inputs[i] == '1')cnt++; i%2 == 0 && inputs[i] == '1' i%2 == 0 i%2 i 2 0 inputs[i] == '1' inputs[i] inputs i '1' cnt++ cnt if(i%2 == 1 && inputs[i] == '0')cnt++; i%2 == 1 && inputs[i] == '0' i%2 == 1 i%2 i 2 1 inputs[i] == '0' inputs[i] inputs i '0' cnt++ cnt ans = ans < cnt ? ans : cnt ans ans < cnt ? ans : cnt ans < cnt ans cnt ans cnt cnt = 0 cnt 0 for(int i = 0; i < inputs.length; i++) {
			if(i%2 == 0 && inputs[i] == '0')cnt++;
			if(i%2 == 1 && inputs[i] == '1')cnt++;
		} int i = 0; int i = 0; i 0 i < inputs.length i inputs.length inputs inputs.length i++ i++ i {
			if(i%2 == 0 && inputs[i] == '0')cnt++;
			if(i%2 == 1 && inputs[i] == '1')cnt++;
		} {
			if(i%2 == 0 && inputs[i] == '0')cnt++;
			if(i%2 == 1 && inputs[i] == '1')cnt++;
		} if(i%2 == 0 && inputs[i] == '0')cnt++; i%2 == 0 && inputs[i] == '0' i%2 == 0 i%2 i 2 0 inputs[i] == '0' inputs[i] inputs i '0' cnt++ cnt if(i%2 == 1 && inputs[i] == '1')cnt++; i%2 == 1 && inputs[i] == '1' i%2 == 1 i%2 i 2 1 inputs[i] == '1' inputs[i] inputs i '1' cnt++ cnt ans = ans < cnt ? ans : cnt ans ans < cnt ? ans : cnt ans < cnt ans cnt ans cnt System.out.println(ans) System.out.println System.out System System.out ans String[] args args
import java.util.*;

class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();
		char[] inputs = line.toCharArray();
		int ans = inputs.length;

		int cnt = 0;
		for(int i = 0; i < inputs.length; i++) {
			if(i%2 == 0 && inputs[i] == '1')cnt++;
			if(i%2 == 1 && inputs[i] == '0')cnt++;
		}
		ans = ans < cnt ? ans : cnt;
		
		cnt = 0;
		for(int i = 0; i < inputs.length; i++) {
			if(i%2 == 0 && inputs[i] == '0')cnt++;
			if(i%2 == 1 && inputs[i] == '1')cnt++;
		}
		ans = ans < cnt ? ans : cnt;

		System.out.println(ans);
	}
}


