import java.util.Scanner;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String tile = sc.next();
		int cnt0 = 0;
		int cnt1 = 0;
		for(int i = 0; i < tile.length(); i++){
			if(i%2 == 0){
				if(tile.charAt(i) != '0'){
					cnt0++;
				}
			}
			if(i%2 == 1){
				if(tile.charAt(i) != '1'){
					cnt0++;
				}
			}
			if(i%2 == 0){
				if(tile.charAt(i) != '1'){
					cnt1++;
				}
			}
			if(i%2 == 1){
				if(tile.charAt(i) != '0'){
					cnt1++;
				}
			}
		}
		System.out.println(Math.min(cnt0,cnt1));
	}
} import java.util.Scanner; Scanner java.util public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String tile = sc.next();
		int cnt0 = 0;
		int cnt1 = 0;
		for(int i = 0; i < tile.length(); i++){
			if(i%2 == 0){
				if(tile.charAt(i) != '0'){
					cnt0++;
				}
			}
			if(i%2 == 1){
				if(tile.charAt(i) != '1'){
					cnt0++;
				}
			}
			if(i%2 == 0){
				if(tile.charAt(i) != '1'){
					cnt1++;
				}
			}
			if(i%2 == 1){
				if(tile.charAt(i) != '0'){
					cnt1++;
				}
			}
		}
		System.out.println(Math.min(cnt0,cnt1));
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String tile = sc.next();
		int cnt0 = 0;
		int cnt1 = 0;
		for(int i = 0; i < tile.length(); i++){
			if(i%2 == 0){
				if(tile.charAt(i) != '0'){
					cnt0++;
				}
			}
			if(i%2 == 1){
				if(tile.charAt(i) != '1'){
					cnt0++;
				}
			}
			if(i%2 == 0){
				if(tile.charAt(i) != '1'){
					cnt1++;
				}
			}
			if(i%2 == 1){
				if(tile.charAt(i) != '0'){
					cnt1++;
				}
			}
		}
		System.out.println(Math.min(cnt0,cnt1));
	} main {
		Scanner sc = new Scanner(System.in);
		String tile = sc.next();
		int cnt0 = 0;
		int cnt1 = 0;
		for(int i = 0; i < tile.length(); i++){
			if(i%2 == 0){
				if(tile.charAt(i) != '0'){
					cnt0++;
				}
			}
			if(i%2 == 1){
				if(tile.charAt(i) != '1'){
					cnt0++;
				}
			}
			if(i%2 == 0){
				if(tile.charAt(i) != '1'){
					cnt1++;
				}
			}
			if(i%2 == 1){
				if(tile.charAt(i) != '0'){
					cnt1++;
				}
			}
		}
		System.out.println(Math.min(cnt0,cnt1));
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String tile = sc.next(); tile sc.next() sc.next sc int cnt0 = 0; cnt0 0 int cnt1 = 0; cnt1 0 for(int i = 0; i < tile.length(); i++){
			if(i%2 == 0){
				if(tile.charAt(i) != '0'){
					cnt0++;
				}
			}
			if(i%2 == 1){
				if(tile.charAt(i) != '1'){
					cnt0++;
				}
			}
			if(i%2 == 0){
				if(tile.charAt(i) != '1'){
					cnt1++;
				}
			}
			if(i%2 == 1){
				if(tile.charAt(i) != '0'){
					cnt1++;
				}
			}
		} int i = 0; int i = 0; i 0 i < tile.length() i tile.length() tile.length tile i++ i++ i {
			if(i%2 == 0){
				if(tile.charAt(i) != '0'){
					cnt0++;
				}
			}
			if(i%2 == 1){
				if(tile.charAt(i) != '1'){
					cnt0++;
				}
			}
			if(i%2 == 0){
				if(tile.charAt(i) != '1'){
					cnt1++;
				}
			}
			if(i%2 == 1){
				if(tile.charAt(i) != '0'){
					cnt1++;
				}
			}
		} {
			if(i%2 == 0){
				if(tile.charAt(i) != '0'){
					cnt0++;
				}
			}
			if(i%2 == 1){
				if(tile.charAt(i) != '1'){
					cnt0++;
				}
			}
			if(i%2 == 0){
				if(tile.charAt(i) != '1'){
					cnt1++;
				}
			}
			if(i%2 == 1){
				if(tile.charAt(i) != '0'){
					cnt1++;
				}
			}
		} if(i%2 == 0){
				if(tile.charAt(i) != '0'){
					cnt0++;
				}
			} i%2 == 0 i%2 i 2 0 {
				if(tile.charAt(i) != '0'){
					cnt0++;
				}
			} if(tile.charAt(i) != '0'){
					cnt0++;
				} tile.charAt(i) != '0' tile.charAt(i) tile.charAt tile i '0' {
					cnt0++;
				} cnt0++ cnt0 if(i%2 == 1){
				if(tile.charAt(i) != '1'){
					cnt0++;
				}
			} i%2 == 1 i%2 i 2 1 {
				if(tile.charAt(i) != '1'){
					cnt0++;
				}
			} if(tile.charAt(i) != '1'){
					cnt0++;
				} tile.charAt(i) != '1' tile.charAt(i) tile.charAt tile i '1' {
					cnt0++;
				} cnt0++ cnt0 if(i%2 == 0){
				if(tile.charAt(i) != '1'){
					cnt1++;
				}
			} i%2 == 0 i%2 i 2 0 {
				if(tile.charAt(i) != '1'){
					cnt1++;
				}
			} if(tile.charAt(i) != '1'){
					cnt1++;
				} tile.charAt(i) != '1' tile.charAt(i) tile.charAt tile i '1' {
					cnt1++;
				} cnt1++ cnt1 if(i%2 == 1){
				if(tile.charAt(i) != '0'){
					cnt1++;
				}
			} i%2 == 1 i%2 i 2 1 {
				if(tile.charAt(i) != '0'){
					cnt1++;
				}
			} if(tile.charAt(i) != '0'){
					cnt1++;
				} tile.charAt(i) != '0' tile.charAt(i) tile.charAt tile i '0' {
					cnt1++;
				} cnt1++ cnt1 System.out.println(Math.min(cnt0,cnt1)) System.out.println System.out System System.out Math.min(cnt0,cnt1) Math.min Math cnt0 cnt1 String[] args args public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String tile = sc.next();
		int cnt0 = 0;
		int cnt1 = 0;
		for(int i = 0; i < tile.length(); i++){
			if(i%2 == 0){
				if(tile.charAt(i) != '0'){
					cnt0++;
				}
			}
			if(i%2 == 1){
				if(tile.charAt(i) != '1'){
					cnt0++;
				}
			}
			if(i%2 == 0){
				if(tile.charAt(i) != '1'){
					cnt1++;
				}
			}
			if(i%2 == 1){
				if(tile.charAt(i) != '0'){
					cnt1++;
				}
			}
		}
		System.out.println(Math.min(cnt0,cnt1));
	}
} public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String tile = sc.next();
		int cnt0 = 0;
		int cnt1 = 0;
		for(int i = 0; i < tile.length(); i++){
			if(i%2 == 0){
				if(tile.charAt(i) != '0'){
					cnt0++;
				}
			}
			if(i%2 == 1){
				if(tile.charAt(i) != '1'){
					cnt0++;
				}
			}
			if(i%2 == 0){
				if(tile.charAt(i) != '1'){
					cnt1++;
				}
			}
			if(i%2 == 1){
				if(tile.charAt(i) != '0'){
					cnt1++;
				}
			}
		}
		System.out.println(Math.min(cnt0,cnt1));
	}
} Main
import java.util.Scanner;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String tile = sc.next();
		int cnt0 = 0;
		int cnt1 = 0;
		for(int i = 0; i < tile.length(); i++){
			if(i%2 == 0){
				if(tile.charAt(i) != '0'){
					cnt0++;
				}
			}
			if(i%2 == 1){
				if(tile.charAt(i) != '1'){
					cnt0++;
				}
			}
			if(i%2 == 0){
				if(tile.charAt(i) != '1'){
					cnt1++;
				}
			}
			if(i%2 == 1){
				if(tile.charAt(i) != '0'){
					cnt1++;
				}
			}
		}
		System.out.println(Math.min(cnt0,cnt1));
	}
}