import java.util.*;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		int count1 = 0;
		int count2 = 0;
		char x;
		for (int i = 0; i<S.length(); i++) {
			x = S.charAt(i);
			if (x == '0') {
				if (i % 2 == 0){
					count1++;
				}
				if (i % 2 == 1) {
					count2++;
				}
			}			
			if (x == '1') {
				if (i % 2 == 1){
					count1++;
				}
				if (i % 2 == 0) {
					count2++;
				}
			}
		}
		if (count1 > count2)
			System.out.println(count2);
		else
			System.out.println(count1);
	}
}	 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 count1 = 0;
		int count2 = 0;
		char x;
		for (int i = 0; i<S.length(); i++) {
			x = S.charAt(i);
			if (x == '0') {
				if (i % 2 == 0){
					count1++;
				}
				if (i % 2 == 1) {
					count2++;
				}
			}			
			if (x == '1') {
				if (i % 2 == 1){
					count1++;
				}
				if (i % 2 == 0) {
					count2++;
				}
			}
		}
		if (count1 > count2)
			System.out.println(count2);
		else
			System.out.println(count1);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		int count1 = 0;
		int count2 = 0;
		char x;
		for (int i = 0; i<S.length(); i++) {
			x = S.charAt(i);
			if (x == '0') {
				if (i % 2 == 0){
					count1++;
				}
				if (i % 2 == 1) {
					count2++;
				}
			}			
			if (x == '1') {
				if (i % 2 == 1){
					count1++;
				}
				if (i % 2 == 0) {
					count2++;
				}
			}
		}
		if (count1 > count2)
			System.out.println(count2);
		else
			System.out.println(count1);
	} main {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		int count1 = 0;
		int count2 = 0;
		char x;
		for (int i = 0; i<S.length(); i++) {
			x = S.charAt(i);
			if (x == '0') {
				if (i % 2 == 0){
					count1++;
				}
				if (i % 2 == 1) {
					count2++;
				}
			}			
			if (x == '1') {
				if (i % 2 == 1){
					count1++;
				}
				if (i % 2 == 0) {
					count2++;
				}
			}
		}
		if (count1 > count2)
			System.out.println(count2);
		else
			System.out.println(count1);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.next(); S sc.next() sc.next sc int count1 = 0; count1 0 int count2 = 0; count2 0 char x; x for (int i = 0; i<S.length(); i++) {
			x = S.charAt(i);
			if (x == '0') {
				if (i % 2 == 0){
					count1++;
				}
				if (i % 2 == 1) {
					count2++;
				}
			}			
			if (x == '1') {
				if (i % 2 == 1){
					count1++;
				}
				if (i % 2 == 0) {
					count2++;
				}
			}
		} int i = 0; int i = 0; i 0 i<S.length() i S.length() S.length S i++ i++ i {
			x = S.charAt(i);
			if (x == '0') {
				if (i % 2 == 0){
					count1++;
				}
				if (i % 2 == 1) {
					count2++;
				}
			}			
			if (x == '1') {
				if (i % 2 == 1){
					count1++;
				}
				if (i % 2 == 0) {
					count2++;
				}
			}
		} {
			x = S.charAt(i);
			if (x == '0') {
				if (i % 2 == 0){
					count1++;
				}
				if (i % 2 == 1) {
					count2++;
				}
			}			
			if (x == '1') {
				if (i % 2 == 1){
					count1++;
				}
				if (i % 2 == 0) {
					count2++;
				}
			}
		} x = S.charAt(i) x S.charAt(i) S.charAt S i if (x == '0') {
				if (i % 2 == 0){
					count1++;
				}
				if (i % 2 == 1) {
					count2++;
				}
			} x == '0' x '0' {
				if (i % 2 == 0){
					count1++;
				}
				if (i % 2 == 1) {
					count2++;
				}
			} if (i % 2 == 0){
					count1++;
				} i % 2 == 0 i % 2 i 2 0 {
					count1++;
				} count1++ count1 if (i % 2 == 1) {
					count2++;
				} i % 2 == 1 i % 2 i 2 1 {
					count2++;
				} count2++ count2 if (x == '1') {
				if (i % 2 == 1){
					count1++;
				}
				if (i % 2 == 0) {
					count2++;
				}
			} x == '1' x '1' {
				if (i % 2 == 1){
					count1++;
				}
				if (i % 2 == 0) {
					count2++;
				}
			} if (i % 2 == 1){
					count1++;
				} i % 2 == 1 i % 2 i 2 1 {
					count1++;
				} count1++ count1 if (i % 2 == 0) {
					count2++;
				} i % 2 == 0 i % 2 i 2 0 {
					count2++;
				} count2++ count2 if (count1 > count2)
			System.out.println(count2);
		else
			System.out.println(count1); count1 > count2 count1 count2 System.out.println(count2) System.out.println System.out System System.out count2 System.out.println(count1) System.out.println System.out System System.out count1 String[] args args public class Main {

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

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		int count1 = 0;
		int count2 = 0;
		char x;
		for (int i = 0; i<S.length(); i++) {
			x = S.charAt(i);
			if (x == '0') {
				if (i % 2 == 0){
					count1++;
				}
				if (i % 2 == 1) {
					count2++;
				}
			}			
			if (x == '1') {
				if (i % 2 == 1){
					count1++;
				}
				if (i % 2 == 0) {
					count2++;
				}
			}
		}
		if (count1 > count2)
			System.out.println(count2);
		else
			System.out.println(count1);
	}
} Main
import java.util.*;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		int count1 = 0;
		int count2 = 0;
		char x;
		for (int i = 0; i<S.length(); i++) {
			x = S.charAt(i);
			if (x == '0') {
				if (i % 2 == 0){
					count1++;
				}
				if (i % 2 == 1) {
					count2++;
				}
			}			
			if (x == '1') {
				if (i % 2 == 1){
					count1++;
				}
				if (i % 2 == 0) {
					count2++;
				}
			}
		}
		if (count1 > count2)
			System.out.println(count2);
		else
			System.out.println(count1);
	}
}	
