

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);

		char[] str = sc.next().toCharArray();

		int count = 0;
		int tmpCount = 0;

		for(int i = 0; i < str.length; i++){
			if((i % 2 == 0 && str[i] == '0') ||( i % 2 == 1 && str[i] == '1')){
				count++;
			}
		}

		for(int i = 0; i < str.length; i++){
			if((i % 2 == 1 && str[i] == '0') ||( i % 2 == 0 && str[i] == '1')){
				tmpCount++;
			}
		}

		System.out.println(Math.min(count, tmpCount));

	}

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

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);

		char[] str = sc.next().toCharArray();

		int count = 0;
		int tmpCount = 0;

		for(int i = 0; i < str.length; i++){
			if((i % 2 == 0 && str[i] == '0') ||( i % 2 == 1 && str[i] == '1')){
				count++;
			}
		}

		for(int i = 0; i < str.length; i++){
			if((i % 2 == 1 && str[i] == '0') ||( i % 2 == 0 && str[i] == '1')){
				tmpCount++;
			}
		}

		System.out.println(Math.min(count, tmpCount));

	}

} Main public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);

		char[] str = sc.next().toCharArray();

		int count = 0;
		int tmpCount = 0;

		for(int i = 0; i < str.length; i++){
			if((i % 2 == 0 && str[i] == '0') ||( i % 2 == 1 && str[i] == '1')){
				count++;
			}
		}

		for(int i = 0; i < str.length; i++){
			if((i % 2 == 1 && str[i] == '0') ||( i % 2 == 0 && str[i] == '1')){
				tmpCount++;
			}
		}

		System.out.println(Math.min(count, tmpCount));

	} main {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);

		char[] str = sc.next().toCharArray();

		int count = 0;
		int tmpCount = 0;

		for(int i = 0; i < str.length; i++){
			if((i % 2 == 0 && str[i] == '0') ||( i % 2 == 1 && str[i] == '1')){
				count++;
			}
		}

		for(int i = 0; i < str.length; i++){
			if((i % 2 == 1 && str[i] == '0') ||( i % 2 == 0 && str[i] == '1')){
				tmpCount++;
			}
		}

		System.out.println(Math.min(count, tmpCount));

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) char[] str = sc.next().toCharArray(); str sc.next().toCharArray() sc.next().toCharArray sc.next() sc.next sc int count = 0; count 0 int tmpCount = 0; tmpCount 0 for(int i = 0; i < str.length; i++){
			if((i % 2 == 0 && str[i] == '0') ||( i % 2 == 1 && str[i] == '1')){
				count++;
			}
		} int i = 0; int i = 0; i 0 i < str.length i str.length str str.length i++ i++ i {
			if((i % 2 == 0 && str[i] == '0') ||( i % 2 == 1 && str[i] == '1')){
				count++;
			}
		} {
			if((i % 2 == 0 && str[i] == '0') ||( i % 2 == 1 && str[i] == '1')){
				count++;
			}
		} if((i % 2 == 0 && str[i] == '0') ||( i % 2 == 1 && str[i] == '1')){
				count++;
			} (i % 2 == 0 && str[i] == '0') ||( i % 2 == 1 && str[i] == '1') (i % 2 == 0 && str[i] == '0') i % 2 == 0 i % 2 i 2 0 str[i] == '0' str[i] str i '0' ( i % 2 == 1 && str[i] == '1') i % 2 == 1 i % 2 i 2 1 str[i] == '1' str[i] str i '1' {
				count++;
			} count++ count for(int i = 0; i < str.length; i++){
			if((i % 2 == 1 && str[i] == '0') ||( i % 2 == 0 && str[i] == '1')){
				tmpCount++;
			}
		} int i = 0; int i = 0; i 0 i < str.length i str.length str str.length i++ i++ i {
			if((i % 2 == 1 && str[i] == '0') ||( i % 2 == 0 && str[i] == '1')){
				tmpCount++;
			}
		} {
			if((i % 2 == 1 && str[i] == '0') ||( i % 2 == 0 && str[i] == '1')){
				tmpCount++;
			}
		} if((i % 2 == 1 && str[i] == '0') ||( i % 2 == 0 && str[i] == '1')){
				tmpCount++;
			} (i % 2 == 1 && str[i] == '0') ||( i % 2 == 0 && str[i] == '1') (i % 2 == 1 && str[i] == '0') i % 2 == 1 i % 2 i 2 1 str[i] == '0' str[i] str i '0' ( i % 2 == 0 && str[i] == '1') i % 2 == 0 i % 2 i 2 0 str[i] == '1' str[i] str i '1' {
				tmpCount++;
			} tmpCount++ tmpCount System.out.println(Math.min(count, tmpCount)) System.out.println System.out System System.out Math.min(count, tmpCount) Math.min Math count tmpCount String[] args args public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);

		char[] str = sc.next().toCharArray();

		int count = 0;
		int tmpCount = 0;

		for(int i = 0; i < str.length; i++){
			if((i % 2 == 0 && str[i] == '0') ||( i % 2 == 1 && str[i] == '1')){
				count++;
			}
		}

		for(int i = 0; i < str.length; i++){
			if((i % 2 == 1 && str[i] == '0') ||( i % 2 == 0 && str[i] == '1')){
				tmpCount++;
			}
		}

		System.out.println(Math.min(count, tmpCount));

	}

} public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);

		char[] str = sc.next().toCharArray();

		int count = 0;
		int tmpCount = 0;

		for(int i = 0; i < str.length; i++){
			if((i % 2 == 0 && str[i] == '0') ||( i % 2 == 1 && str[i] == '1')){
				count++;
			}
		}

		for(int i = 0; i < str.length; i++){
			if((i % 2 == 1 && str[i] == '0') ||( i % 2 == 0 && str[i] == '1')){
				tmpCount++;
			}
		}

		System.out.println(Math.min(count, tmpCount));

	}

} Main


import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);

		char[] str = sc.next().toCharArray();

		int count = 0;
		int tmpCount = 0;

		for(int i = 0; i < str.length; i++){
			if((i % 2 == 0 && str[i] == '0') ||( i % 2 == 1 && str[i] == '1')){
				count++;
			}
		}

		for(int i = 0; i < str.length; i++){
			if((i % 2 == 1 && str[i] == '0') ||( i % 2 == 0 && str[i] == '1')){
				tmpCount++;
			}
		}

		System.out.println(Math.min(count, tmpCount));

	}

}