import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();

		int count_1 = 0;
		for (int i=0; i<S.length(); i++){
			if (i%2 == 0){
				if (S.charAt(i) == '0'){
					count_1 += 1;
				}
			}else if (i%2 == 1){
				if (S.charAt(i) == '1'){
					count_1 += 1;
				}
			}
		}

		int count_2 = 0;
		for (int i=0; i<S.length(); i++){
			if (i%2 == 0){
				if (S.charAt(i) == '1'){
					count_2 += 1;
				}
			}else if (i%2 == 1){
				if (S.charAt(i) == '0'){
					count_2 += 1;
				}
			}
		}

		System.out.println(Math.min(count_1, count_2));
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();

		int count_1 = 0;
		for (int i=0; i<S.length(); i++){
			if (i%2 == 0){
				if (S.charAt(i) == '0'){
					count_1 += 1;
				}
			}else if (i%2 == 1){
				if (S.charAt(i) == '1'){
					count_1 += 1;
				}
			}
		}

		int count_2 = 0;
		for (int i=0; i<S.length(); i++){
			if (i%2 == 0){
				if (S.charAt(i) == '1'){
					count_2 += 1;
				}
			}else if (i%2 == 1){
				if (S.charAt(i) == '0'){
					count_2 += 1;
				}
			}
		}

		System.out.println(Math.min(count_1, count_2));
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();

		int count_1 = 0;
		for (int i=0; i<S.length(); i++){
			if (i%2 == 0){
				if (S.charAt(i) == '0'){
					count_1 += 1;
				}
			}else if (i%2 == 1){
				if (S.charAt(i) == '1'){
					count_1 += 1;
				}
			}
		}

		int count_2 = 0;
		for (int i=0; i<S.length(); i++){
			if (i%2 == 0){
				if (S.charAt(i) == '1'){
					count_2 += 1;
				}
			}else if (i%2 == 1){
				if (S.charAt(i) == '0'){
					count_2 += 1;
				}
			}
		}

		System.out.println(Math.min(count_1, count_2));
	} main {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();

		int count_1 = 0;
		for (int i=0; i<S.length(); i++){
			if (i%2 == 0){
				if (S.charAt(i) == '0'){
					count_1 += 1;
				}
			}else if (i%2 == 1){
				if (S.charAt(i) == '1'){
					count_1 += 1;
				}
			}
		}

		int count_2 = 0;
		for (int i=0; i<S.length(); i++){
			if (i%2 == 0){
				if (S.charAt(i) == '1'){
					count_2 += 1;
				}
			}else if (i%2 == 1){
				if (S.charAt(i) == '0'){
					count_2 += 1;
				}
			}
		}

		System.out.println(Math.min(count_1, count_2));
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.next(); S sc.next() sc.next sc int count_1 = 0; count_1 0 for (int i=0; i<S.length(); i++){
			if (i%2 == 0){
				if (S.charAt(i) == '0'){
					count_1 += 1;
				}
			}else if (i%2 == 1){
				if (S.charAt(i) == '1'){
					count_1 += 1;
				}
			}
		} int i=0; int i=0; i 0 i<S.length() i S.length() S.length S i++ i++ i {
			if (i%2 == 0){
				if (S.charAt(i) == '0'){
					count_1 += 1;
				}
			}else if (i%2 == 1){
				if (S.charAt(i) == '1'){
					count_1 += 1;
				}
			}
		} {
			if (i%2 == 0){
				if (S.charAt(i) == '0'){
					count_1 += 1;
				}
			}else if (i%2 == 1){
				if (S.charAt(i) == '1'){
					count_1 += 1;
				}
			}
		} if (i%2 == 0){
				if (S.charAt(i) == '0'){
					count_1 += 1;
				}
			}else if (i%2 == 1){
				if (S.charAt(i) == '1'){
					count_1 += 1;
				}
			} i%2 == 0 i%2 i 2 0 {
				if (S.charAt(i) == '0'){
					count_1 += 1;
				}
			} if (S.charAt(i) == '0'){
					count_1 += 1;
				} S.charAt(i) == '0' S.charAt(i) S.charAt S i '0' {
					count_1 += 1;
				} count_1 += 1 count_1 1 if (i%2 == 1){
				if (S.charAt(i) == '1'){
					count_1 += 1;
				}
			} i%2 == 1 i%2 i 2 1 {
				if (S.charAt(i) == '1'){
					count_1 += 1;
				}
			} if (S.charAt(i) == '1'){
					count_1 += 1;
				} S.charAt(i) == '1' S.charAt(i) S.charAt S i '1' {
					count_1 += 1;
				} count_1 += 1 count_1 1 int count_2 = 0; count_2 0 for (int i=0; i<S.length(); i++){
			if (i%2 == 0){
				if (S.charAt(i) == '1'){
					count_2 += 1;
				}
			}else if (i%2 == 1){
				if (S.charAt(i) == '0'){
					count_2 += 1;
				}
			}
		} int i=0; int i=0; i 0 i<S.length() i S.length() S.length S i++ i++ i {
			if (i%2 == 0){
				if (S.charAt(i) == '1'){
					count_2 += 1;
				}
			}else if (i%2 == 1){
				if (S.charAt(i) == '0'){
					count_2 += 1;
				}
			}
		} {
			if (i%2 == 0){
				if (S.charAt(i) == '1'){
					count_2 += 1;
				}
			}else if (i%2 == 1){
				if (S.charAt(i) == '0'){
					count_2 += 1;
				}
			}
		} if (i%2 == 0){
				if (S.charAt(i) == '1'){
					count_2 += 1;
				}
			}else if (i%2 == 1){
				if (S.charAt(i) == '0'){
					count_2 += 1;
				}
			} i%2 == 0 i%2 i 2 0 {
				if (S.charAt(i) == '1'){
					count_2 += 1;
				}
			} if (S.charAt(i) == '1'){
					count_2 += 1;
				} S.charAt(i) == '1' S.charAt(i) S.charAt S i '1' {
					count_2 += 1;
				} count_2 += 1 count_2 1 if (i%2 == 1){
				if (S.charAt(i) == '0'){
					count_2 += 1;
				}
			} i%2 == 1 i%2 i 2 1 {
				if (S.charAt(i) == '0'){
					count_2 += 1;
				}
			} if (S.charAt(i) == '0'){
					count_2 += 1;
				} S.charAt(i) == '0' S.charAt(i) S.charAt S i '0' {
					count_2 += 1;
				} count_2 += 1 count_2 1 System.out.println(Math.min(count_1, count_2)) System.out.println System.out System System.out Math.min(count_1, count_2) Math.min Math count_1 count_2 String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();

		int count_1 = 0;
		for (int i=0; i<S.length(); i++){
			if (i%2 == 0){
				if (S.charAt(i) == '0'){
					count_1 += 1;
				}
			}else if (i%2 == 1){
				if (S.charAt(i) == '1'){
					count_1 += 1;
				}
			}
		}

		int count_2 = 0;
		for (int i=0; i<S.length(); i++){
			if (i%2 == 0){
				if (S.charAt(i) == '1'){
					count_2 += 1;
				}
			}else if (i%2 == 1){
				if (S.charAt(i) == '0'){
					count_2 += 1;
				}
			}
		}

		System.out.println(Math.min(count_1, count_2));
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();

		int count_1 = 0;
		for (int i=0; i<S.length(); i++){
			if (i%2 == 0){
				if (S.charAt(i) == '0'){
					count_1 += 1;
				}
			}else if (i%2 == 1){
				if (S.charAt(i) == '1'){
					count_1 += 1;
				}
			}
		}

		int count_2 = 0;
		for (int i=0; i<S.length(); i++){
			if (i%2 == 0){
				if (S.charAt(i) == '1'){
					count_2 += 1;
				}
			}else if (i%2 == 1){
				if (S.charAt(i) == '0'){
					count_2 += 1;
				}
			}
		}

		System.out.println(Math.min(count_1, count_2));
	}
} Main
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();

		int count_1 = 0;
		for (int i=0; i<S.length(); i++){
			if (i%2 == 0){
				if (S.charAt(i) == '0'){
					count_1 += 1;
				}
			}else if (i%2 == 1){
				if (S.charAt(i) == '1'){
					count_1 += 1;
				}
			}
		}

		int count_2 = 0;
		for (int i=0; i<S.length(); i++){
			if (i%2 == 0){
				if (S.charAt(i) == '1'){
					count_2 += 1;
				}
			}else if (i%2 == 1){
				if (S.charAt(i) == '0'){
					count_2 += 1;
				}
			}
		}

		System.out.println(Math.min(count_1, count_2));
	}
}