//package at_coder;

import java.util.Scanner;

public class Main{
	public static void main(String[] args) {
		Scanner sc =  new Scanner(System.in);
		String str = sc.next();
		int length = str.length();
		char[] num = {'0','1'};
		int count = 0;
		for(int i=0;i<length;i++)
			if(str.charAt(i)==num[i%2])
				count++;
		System.out.println(count <= length/2 ? count : length-count);
	}
} import java.util.Scanner; Scanner java.util public class Main{
	public static void main(String[] args) {
		Scanner sc =  new Scanner(System.in);
		String str = sc.next();
		int length = str.length();
		char[] num = {'0','1'};
		int count = 0;
		for(int i=0;i<length;i++)
			if(str.charAt(i)==num[i%2])
				count++;
		System.out.println(count <= length/2 ? count : length-count);
	}
} Main public static void main(String[] args) {
		Scanner sc =  new Scanner(System.in);
		String str = sc.next();
		int length = str.length();
		char[] num = {'0','1'};
		int count = 0;
		for(int i=0;i<length;i++)
			if(str.charAt(i)==num[i%2])
				count++;
		System.out.println(count <= length/2 ? count : length-count);
	} main {
		Scanner sc =  new Scanner(System.in);
		String str = sc.next();
		int length = str.length();
		char[] num = {'0','1'};
		int count = 0;
		for(int i=0;i<length;i++)
			if(str.charAt(i)==num[i%2])
				count++;
		System.out.println(count <= length/2 ? count : length-count);
	} Scanner sc =  new Scanner(System.in); sc new Scanner(System.in) String str = sc.next(); str sc.next() sc.next sc int length = str.length(); length str.length() str.length str char[] num = {'0','1'}; num {'0','1'} '0' '1' int count = 0; count 0 for(int i=0;i<length;i++)
			if(str.charAt(i)==num[i%2])
				count++; int i=0; int i=0; i 0 i<length i length i++ i++ i if(str.charAt(i)==num[i%2])
				count++; if(str.charAt(i)==num[i%2])
				count++; str.charAt(i)==num[i%2] str.charAt(i) str.charAt str i num[i%2] num i%2 i 2 count++ count System.out.println(count <= length/2 ? count : length-count) System.out.println System.out System System.out count <= length/2 ? count : length-count count <= length/2 count length/2 length 2 count length-count length count String[] args args public class Main{
	public static void main(String[] args) {
		Scanner sc =  new Scanner(System.in);
		String str = sc.next();
		int length = str.length();
		char[] num = {'0','1'};
		int count = 0;
		for(int i=0;i<length;i++)
			if(str.charAt(i)==num[i%2])
				count++;
		System.out.println(count <= length/2 ? count : length-count);
	}
} public class Main{
	public static void main(String[] args) {
		Scanner sc =  new Scanner(System.in);
		String str = sc.next();
		int length = str.length();
		char[] num = {'0','1'};
		int count = 0;
		for(int i=0;i<length;i++)
			if(str.charAt(i)==num[i%2])
				count++;
		System.out.println(count <= length/2 ? count : length-count);
	}
} Main
//package at_coder;

import java.util.Scanner;

public class Main{
	public static void main(String[] args) {
		Scanner sc =  new Scanner(System.in);
		String str = sc.next();
		int length = str.length();
		char[] num = {'0','1'};
		int count = 0;
		for(int i=0;i<length;i++)
			if(str.charAt(i)==num[i%2])
				count++;
		System.out.println(count <= length/2 ? count : length-count);
	}
}