import java.util.Scanner;

class Main{

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		int count = 0;
		String t;
		
		for(int i = 1; i <= s.length(); i++) {
			t = s.substring(i-1,i);
			if(t.equals(String.valueOf(i % 2))) {
				count ++;
			}
		}
			System.out.println(Math.min(count, s.length() - count));
	}
} import java.util.Scanner; Scanner java.util class Main{

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		int count = 0;
		String t;
		
		for(int i = 1; i <= s.length(); i++) {
			t = s.substring(i-1,i);
			if(t.equals(String.valueOf(i % 2))) {
				count ++;
			}
		}
			System.out.println(Math.min(count, s.length() - count));
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		int count = 0;
		String t;
		
		for(int i = 1; i <= s.length(); i++) {
			t = s.substring(i-1,i);
			if(t.equals(String.valueOf(i % 2))) {
				count ++;
			}
		}
			System.out.println(Math.min(count, s.length() - count));
	} main {
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		int count = 0;
		String t;
		
		for(int i = 1; i <= s.length(); i++) {
			t = s.substring(i-1,i);
			if(t.equals(String.valueOf(i % 2))) {
				count ++;
			}
		}
			System.out.println(Math.min(count, s.length() - count));
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.nextLine(); s sc.nextLine() sc.nextLine sc int count = 0; count 0 String t; t for(int i = 1; i <= s.length(); i++) {
			t = s.substring(i-1,i);
			if(t.equals(String.valueOf(i % 2))) {
				count ++;
			}
		} int i = 1; int i = 1; i 1 i <= s.length() i s.length() s.length s i++ i++ i {
			t = s.substring(i-1,i);
			if(t.equals(String.valueOf(i % 2))) {
				count ++;
			}
		} {
			t = s.substring(i-1,i);
			if(t.equals(String.valueOf(i % 2))) {
				count ++;
			}
		} t = s.substring(i-1,i) t s.substring(i-1,i) s.substring s i-1 i 1 i if(t.equals(String.valueOf(i % 2))) {
				count ++;
			} t.equals(String.valueOf(i % 2)) t.equals t String.valueOf(i % 2) String.valueOf String i % 2 i 2 {
				count ++;
			} count ++ count System.out.println(Math.min(count, s.length() - count)) System.out.println System.out System System.out Math.min(count, s.length() - count) Math.min Math count s.length() - count s.length() s.length s count String[] args args
import java.util.Scanner;

class Main{

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		int count = 0;
		String t;
		
		for(int i = 1; i <= s.length(); i++) {
			t = s.substring(i-1,i);
			if(t.equals(String.valueOf(i % 2))) {
				count ++;
			}
		}
			System.out.println(Math.min(count, s.length() - count));
	}
}