import java.util.Scanner;

class Main{

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);			//文字の入力
		String ss = sc.next();
		int onefirst = 0;
		for(int i = 0;i < ss.length();i++){		//1010101
			if(ss.charAt(i) == '0' && i%2 == 0){
				onefirst++;
			}else if(ss.charAt(i) == '1' && i%2 == 1 ){
				onefirst++;
			}
		}
		
		int zerofirst = 0;
		for(int i = 0;i < ss.length();i++){		//010101
			if(ss.charAt(i) == '1' && i%2 == 0){
				zerofirst++;
			}else if(ss.charAt(i) == '0' && i%2 == 1 ){
				zerofirst++;
			}
		}
		
		int ans = Math.min(onefirst, zerofirst);
		System.out.print(ans);
		
		
		
		
		
	}
	


}


class Pair implements Comparable{
	int from;
	int end;
	@Override
	public int compareTo(Object other) {
		Pair otherpair = (Pair)other;

		return from - otherpair.from;
	}
}

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

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);			//文字の入力
		String ss = sc.next();
		int onefirst = 0;
		for(int i = 0;i < ss.length();i++){		//1010101
			if(ss.charAt(i) == '0' && i%2 == 0){
				onefirst++;
			}else if(ss.charAt(i) == '1' && i%2 == 1 ){
				onefirst++;
			}
		}
		
		int zerofirst = 0;
		for(int i = 0;i < ss.length();i++){		//010101
			if(ss.charAt(i) == '1' && i%2 == 0){
				zerofirst++;
			}else if(ss.charAt(i) == '0' && i%2 == 1 ){
				zerofirst++;
			}
		}
		
		int ans = Math.min(onefirst, zerofirst);
		System.out.print(ans);
		
		
		
		
		
	}
	


} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);			//文字の入力
		String ss = sc.next();
		int onefirst = 0;
		for(int i = 0;i < ss.length();i++){		//1010101
			if(ss.charAt(i) == '0' && i%2 == 0){
				onefirst++;
			}else if(ss.charAt(i) == '1' && i%2 == 1 ){
				onefirst++;
			}
		}
		
		int zerofirst = 0;
		for(int i = 0;i < ss.length();i++){		//010101
			if(ss.charAt(i) == '1' && i%2 == 0){
				zerofirst++;
			}else if(ss.charAt(i) == '0' && i%2 == 1 ){
				zerofirst++;
			}
		}
		
		int ans = Math.min(onefirst, zerofirst);
		System.out.print(ans);
		
		
		
		
		
	} main {
		Scanner sc = new Scanner(System.in);			//文字の入力
		String ss = sc.next();
		int onefirst = 0;
		for(int i = 0;i < ss.length();i++){		//1010101
			if(ss.charAt(i) == '0' && i%2 == 0){
				onefirst++;
			}else if(ss.charAt(i) == '1' && i%2 == 1 ){
				onefirst++;
			}
		}
		
		int zerofirst = 0;
		for(int i = 0;i < ss.length();i++){		//010101
			if(ss.charAt(i) == '1' && i%2 == 0){
				zerofirst++;
			}else if(ss.charAt(i) == '0' && i%2 == 1 ){
				zerofirst++;
			}
		}
		
		int ans = Math.min(onefirst, zerofirst);
		System.out.print(ans);
		
		
		
		
		
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String ss = sc.next(); ss sc.next() sc.next sc int onefirst = 0; onefirst 0 for(int i = 0;i < ss.length();i++){		//1010101
			if(ss.charAt(i) == '0' && i%2 == 0){
				onefirst++;
			}else if(ss.charAt(i) == '1' && i%2 == 1 ){
				onefirst++;
			}
		} int i = 0; int i = 0; i 0 i < ss.length() i ss.length() ss.length ss i++ i++ i {		//1010101
			if(ss.charAt(i) == '0' && i%2 == 0){
				onefirst++;
			}else if(ss.charAt(i) == '1' && i%2 == 1 ){
				onefirst++;
			}
		} {		//1010101
			if(ss.charAt(i) == '0' && i%2 == 0){
				onefirst++;
			}else if(ss.charAt(i) == '1' && i%2 == 1 ){
				onefirst++;
			}
		} if(ss.charAt(i) == '0' && i%2 == 0){
				onefirst++;
			}else if(ss.charAt(i) == '1' && i%2 == 1 ){
				onefirst++;
			} ss.charAt(i) == '0' && i%2 == 0 ss.charAt(i) == '0' ss.charAt(i) ss.charAt ss i '0' i%2 == 0 i%2 i 2 0 {
				onefirst++;
			} onefirst++ onefirst if(ss.charAt(i) == '1' && i%2 == 1 ){
				onefirst++;
			} ss.charAt(i) == '1' && i%2 == 1 ss.charAt(i) == '1' ss.charAt(i) ss.charAt ss i '1' i%2 == 1 i%2 i 2 1 {
				onefirst++;
			} onefirst++ onefirst int zerofirst = 0; zerofirst 0 for(int i = 0;i < ss.length();i++){		//010101
			if(ss.charAt(i) == '1' && i%2 == 0){
				zerofirst++;
			}else if(ss.charAt(i) == '0' && i%2 == 1 ){
				zerofirst++;
			}
		} int i = 0; int i = 0; i 0 i < ss.length() i ss.length() ss.length ss i++ i++ i {		//010101
			if(ss.charAt(i) == '1' && i%2 == 0){
				zerofirst++;
			}else if(ss.charAt(i) == '0' && i%2 == 1 ){
				zerofirst++;
			}
		} {		//010101
			if(ss.charAt(i) == '1' && i%2 == 0){
				zerofirst++;
			}else if(ss.charAt(i) == '0' && i%2 == 1 ){
				zerofirst++;
			}
		} if(ss.charAt(i) == '1' && i%2 == 0){
				zerofirst++;
			}else if(ss.charAt(i) == '0' && i%2 == 1 ){
				zerofirst++;
			} ss.charAt(i) == '1' && i%2 == 0 ss.charAt(i) == '1' ss.charAt(i) ss.charAt ss i '1' i%2 == 0 i%2 i 2 0 {
				zerofirst++;
			} zerofirst++ zerofirst if(ss.charAt(i) == '0' && i%2 == 1 ){
				zerofirst++;
			} ss.charAt(i) == '0' && i%2 == 1 ss.charAt(i) == '0' ss.charAt(i) ss.charAt ss i '0' i%2 == 1 i%2 i 2 1 {
				zerofirst++;
			} zerofirst++ zerofirst int ans = Math.min(onefirst, zerofirst); ans Math.min(onefirst, zerofirst) Math.min Math onefirst zerofirst System.out.print(ans) System.out.print System.out System System.out ans String[] args args class Pair implements Comparable{
	int from;
	int end;
	@Override
	public int compareTo(Object other) {
		Pair otherpair = (Pair)other;

		return from - otherpair.from;
	}
} Pair int from; from int end; end @Override
	public int compareTo(Object other) {
		Pair otherpair = (Pair)other;

		return from - otherpair.from;
	} compareTo {
		Pair otherpair = (Pair)other;

		return from - otherpair.from;
	} Pair otherpair = (Pair)other; otherpair (Pair)other return from - otherpair.from; from - otherpair.from from otherpair.from otherpair otherpair.from Object other other Comparable
import java.util.Scanner;

class Main{

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);			//文字の入力
		String ss = sc.next();
		int onefirst = 0;
		for(int i = 0;i < ss.length();i++){		//1010101
			if(ss.charAt(i) == '0' && i%2 == 0){
				onefirst++;
			}else if(ss.charAt(i) == '1' && i%2 == 1 ){
				onefirst++;
			}
		}
		
		int zerofirst = 0;
		for(int i = 0;i < ss.length();i++){		//010101
			if(ss.charAt(i) == '1' && i%2 == 0){
				zerofirst++;
			}else if(ss.charAt(i) == '0' && i%2 == 1 ){
				zerofirst++;
			}
		}
		
		int ans = Math.min(onefirst, zerofirst);
		System.out.print(ans);
		
		
		
		
		
	}
	


}


class Pair implements Comparable{
	int from;
	int end;
	@Override
	public int compareTo(Object other) {
		Pair otherpair = (Pair)other;

		return from - otherpair.from;
	}
}


