import java.util.ArrayList;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		String str = in.nextLine();
		int[] arr = new int[str.length()];
		int[] arr2 = new int[str.length()];
		int a=0,b=0;
		for(int i=0; i<str.length(); i++){
			arr[i] = str.charAt(i)-48;
			if(i%2==0){
				arr2[i]=1;
			}
		}
		for(int i=0; i<str.length(); i++){
			if(arr[i]==arr2[i]){
				a++;
			}
			else{
				b++;
			}
		}
		System.out.println(Math.min(a, b));
	}

} import java.util.ArrayList; ArrayList java.util import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		String str = in.nextLine();
		int[] arr = new int[str.length()];
		int[] arr2 = new int[str.length()];
		int a=0,b=0;
		for(int i=0; i<str.length(); i++){
			arr[i] = str.charAt(i)-48;
			if(i%2==0){
				arr2[i]=1;
			}
		}
		for(int i=0; i<str.length(); i++){
			if(arr[i]==arr2[i]){
				a++;
			}
			else{
				b++;
			}
		}
		System.out.println(Math.min(a, b));
	}

} Main public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		String str = in.nextLine();
		int[] arr = new int[str.length()];
		int[] arr2 = new int[str.length()];
		int a=0,b=0;
		for(int i=0; i<str.length(); i++){
			arr[i] = str.charAt(i)-48;
			if(i%2==0){
				arr2[i]=1;
			}
		}
		for(int i=0; i<str.length(); i++){
			if(arr[i]==arr2[i]){
				a++;
			}
			else{
				b++;
			}
		}
		System.out.println(Math.min(a, b));
	} main {
		Scanner in = new Scanner(System.in);
		String str = in.nextLine();
		int[] arr = new int[str.length()];
		int[] arr2 = new int[str.length()];
		int a=0,b=0;
		for(int i=0; i<str.length(); i++){
			arr[i] = str.charAt(i)-48;
			if(i%2==0){
				arr2[i]=1;
			}
		}
		for(int i=0; i<str.length(); i++){
			if(arr[i]==arr2[i]){
				a++;
			}
			else{
				b++;
			}
		}
		System.out.println(Math.min(a, b));
	} Scanner in = new Scanner(System.in); in new Scanner(System.in) String str = in.nextLine(); str in.nextLine() in.nextLine in int[] arr = new int[str.length()]; arr new int[str.length()] str.length() str.length str int[] arr2 = new int[str.length()]; arr2 new int[str.length()] str.length() str.length str int a=0 a 0 b=0; b 0 for(int i=0; i<str.length(); i++){
			arr[i] = str.charAt(i)-48;
			if(i%2==0){
				arr2[i]=1;
			}
		} int i=0; int i=0; i 0 i<str.length() i str.length() str.length str i++ i++ i {
			arr[i] = str.charAt(i)-48;
			if(i%2==0){
				arr2[i]=1;
			}
		} {
			arr[i] = str.charAt(i)-48;
			if(i%2==0){
				arr2[i]=1;
			}
		} arr[i] = str.charAt(i)-48 arr[i] arr i str.charAt(i)-48 str.charAt(i) str.charAt str i 48 if(i%2==0){
				arr2[i]=1;
			} i%2==0 i%2 i 2 0 {
				arr2[i]=1;
			} arr2[i]=1 arr2[i] arr2 i 1 for(int i=0; i<str.length(); i++){
			if(arr[i]==arr2[i]){
				a++;
			}
			else{
				b++;
			}
		} int i=0; int i=0; i 0 i<str.length() i str.length() str.length str i++ i++ i {
			if(arr[i]==arr2[i]){
				a++;
			}
			else{
				b++;
			}
		} {
			if(arr[i]==arr2[i]){
				a++;
			}
			else{
				b++;
			}
		} if(arr[i]==arr2[i]){
				a++;
			}
			else{
				b++;
			} arr[i]==arr2[i] arr[i] arr i arr2[i] arr2 i {
				a++;
			} a++ a {
				b++;
			} b++ b System.out.println(Math.min(a, b)) System.out.println System.out System System.out Math.min(a, b) Math.min Math a b String[] args args public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		String str = in.nextLine();
		int[] arr = new int[str.length()];
		int[] arr2 = new int[str.length()];
		int a=0,b=0;
		for(int i=0; i<str.length(); i++){
			arr[i] = str.charAt(i)-48;
			if(i%2==0){
				arr2[i]=1;
			}
		}
		for(int i=0; i<str.length(); i++){
			if(arr[i]==arr2[i]){
				a++;
			}
			else{
				b++;
			}
		}
		System.out.println(Math.min(a, b));
	}

} public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		String str = in.nextLine();
		int[] arr = new int[str.length()];
		int[] arr2 = new int[str.length()];
		int a=0,b=0;
		for(int i=0; i<str.length(); i++){
			arr[i] = str.charAt(i)-48;
			if(i%2==0){
				arr2[i]=1;
			}
		}
		for(int i=0; i<str.length(); i++){
			if(arr[i]==arr2[i]){
				a++;
			}
			else{
				b++;
			}
		}
		System.out.println(Math.min(a, b));
	}

} Main
import java.util.ArrayList;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		String str = in.nextLine();
		int[] arr = new int[str.length()];
		int[] arr2 = new int[str.length()];
		int a=0,b=0;
		for(int i=0; i<str.length(); i++){
			arr[i] = str.charAt(i)-48;
			if(i%2==0){
				arr2[i]=1;
			}
		}
		for(int i=0; i<str.length(); i++){
			if(arr[i]==arr2[i]){
				a++;
			}
			else{
				b++;
			}
		}
		System.out.println(Math.min(a, b));
	}

}