import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		char s[] = scan.next().toCharArray();
		char zero_start[] = new char[s.length];
		char one_start[] = new char[s.length];

		int zero_count = 0;
		int one_count = 0;

		for (int i = 0; i < s.length; i++) {
			if (i % 2 == 0) {
				zero_start[i] = '0';
				one_start[i] = '1';
			}else {
				zero_start[i] = '1';
				one_start[i] = '0';
			}
		}

		for(int i = 0; i < s.length; i++) {
			if(s[i] != zero_start[i]) {
				zero_count++;
			}
			if(s[i] != one_start[i]) {
				one_count++;
			}
		}

		System.out.println(Math.min(zero_count, one_count));
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		char s[] = scan.next().toCharArray();
		char zero_start[] = new char[s.length];
		char one_start[] = new char[s.length];

		int zero_count = 0;
		int one_count = 0;

		for (int i = 0; i < s.length; i++) {
			if (i % 2 == 0) {
				zero_start[i] = '0';
				one_start[i] = '1';
			}else {
				zero_start[i] = '1';
				one_start[i] = '0';
			}
		}

		for(int i = 0; i < s.length; i++) {
			if(s[i] != zero_start[i]) {
				zero_count++;
			}
			if(s[i] != one_start[i]) {
				one_count++;
			}
		}

		System.out.println(Math.min(zero_count, one_count));
	}
} Main public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		char s[] = scan.next().toCharArray();
		char zero_start[] = new char[s.length];
		char one_start[] = new char[s.length];

		int zero_count = 0;
		int one_count = 0;

		for (int i = 0; i < s.length; i++) {
			if (i % 2 == 0) {
				zero_start[i] = '0';
				one_start[i] = '1';
			}else {
				zero_start[i] = '1';
				one_start[i] = '0';
			}
		}

		for(int i = 0; i < s.length; i++) {
			if(s[i] != zero_start[i]) {
				zero_count++;
			}
			if(s[i] != one_start[i]) {
				one_count++;
			}
		}

		System.out.println(Math.min(zero_count, one_count));
	} main {

		Scanner scan = new Scanner(System.in);
		char s[] = scan.next().toCharArray();
		char zero_start[] = new char[s.length];
		char one_start[] = new char[s.length];

		int zero_count = 0;
		int one_count = 0;

		for (int i = 0; i < s.length; i++) {
			if (i % 2 == 0) {
				zero_start[i] = '0';
				one_start[i] = '1';
			}else {
				zero_start[i] = '1';
				one_start[i] = '0';
			}
		}

		for(int i = 0; i < s.length; i++) {
			if(s[i] != zero_start[i]) {
				zero_count++;
			}
			if(s[i] != one_start[i]) {
				one_count++;
			}
		}

		System.out.println(Math.min(zero_count, one_count));
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) char s[] = scan.next().toCharArray(); s scan.next().toCharArray() scan.next().toCharArray scan.next() scan.next scan char zero_start[] = new char[s.length]; zero_start new char[s.length] s.length s s.length char one_start[] = new char[s.length]; one_start new char[s.length] s.length s s.length int zero_count = 0; zero_count 0 int one_count = 0; one_count 0 for (int i = 0; i < s.length; i++) {
			if (i % 2 == 0) {
				zero_start[i] = '0';
				one_start[i] = '1';
			}else {
				zero_start[i] = '1';
				one_start[i] = '0';
			}
		} int i = 0; int i = 0; i 0 i < s.length i s.length s s.length i++ i++ i {
			if (i % 2 == 0) {
				zero_start[i] = '0';
				one_start[i] = '1';
			}else {
				zero_start[i] = '1';
				one_start[i] = '0';
			}
		} {
			if (i % 2 == 0) {
				zero_start[i] = '0';
				one_start[i] = '1';
			}else {
				zero_start[i] = '1';
				one_start[i] = '0';
			}
		} if (i % 2 == 0) {
				zero_start[i] = '0';
				one_start[i] = '1';
			}else {
				zero_start[i] = '1';
				one_start[i] = '0';
			} i % 2 == 0 i % 2 i 2 0 {
				zero_start[i] = '0';
				one_start[i] = '1';
			} zero_start[i] = '0' zero_start[i] zero_start i '0' one_start[i] = '1' one_start[i] one_start i '1' {
				zero_start[i] = '1';
				one_start[i] = '0';
			} zero_start[i] = '1' zero_start[i] zero_start i '1' one_start[i] = '0' one_start[i] one_start i '0' for(int i = 0; i < s.length; i++) {
			if(s[i] != zero_start[i]) {
				zero_count++;
			}
			if(s[i] != one_start[i]) {
				one_count++;
			}
		} int i = 0; int i = 0; i 0 i < s.length i s.length s s.length i++ i++ i {
			if(s[i] != zero_start[i]) {
				zero_count++;
			}
			if(s[i] != one_start[i]) {
				one_count++;
			}
		} {
			if(s[i] != zero_start[i]) {
				zero_count++;
			}
			if(s[i] != one_start[i]) {
				one_count++;
			}
		} if(s[i] != zero_start[i]) {
				zero_count++;
			} s[i] != zero_start[i] s[i] s i zero_start[i] zero_start i {
				zero_count++;
			} zero_count++ zero_count if(s[i] != one_start[i]) {
				one_count++;
			} s[i] != one_start[i] s[i] s i one_start[i] one_start i {
				one_count++;
			} one_count++ one_count System.out.println(Math.min(zero_count, one_count)) System.out.println System.out System System.out Math.min(zero_count, one_count) Math.min Math zero_count one_count String[] args args public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		char s[] = scan.next().toCharArray();
		char zero_start[] = new char[s.length];
		char one_start[] = new char[s.length];

		int zero_count = 0;
		int one_count = 0;

		for (int i = 0; i < s.length; i++) {
			if (i % 2 == 0) {
				zero_start[i] = '0';
				one_start[i] = '1';
			}else {
				zero_start[i] = '1';
				one_start[i] = '0';
			}
		}

		for(int i = 0; i < s.length; i++) {
			if(s[i] != zero_start[i]) {
				zero_count++;
			}
			if(s[i] != one_start[i]) {
				one_count++;
			}
		}

		System.out.println(Math.min(zero_count, one_count));
	}
} public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		char s[] = scan.next().toCharArray();
		char zero_start[] = new char[s.length];
		char one_start[] = new char[s.length];

		int zero_count = 0;
		int one_count = 0;

		for (int i = 0; i < s.length; i++) {
			if (i % 2 == 0) {
				zero_start[i] = '0';
				one_start[i] = '1';
			}else {
				zero_start[i] = '1';
				one_start[i] = '0';
			}
		}

		for(int i = 0; i < s.length; i++) {
			if(s[i] != zero_start[i]) {
				zero_count++;
			}
			if(s[i] != one_start[i]) {
				one_count++;
			}
		}

		System.out.println(Math.min(zero_count, one_count));
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		char s[] = scan.next().toCharArray();
		char zero_start[] = new char[s.length];
		char one_start[] = new char[s.length];

		int zero_count = 0;
		int one_count = 0;

		for (int i = 0; i < s.length; i++) {
			if (i % 2 == 0) {
				zero_start[i] = '0';
				one_start[i] = '1';
			}else {
				zero_start[i] = '1';
				one_start[i] = '0';
			}
		}

		for(int i = 0; i < s.length; i++) {
			if(s[i] != zero_start[i]) {
				zero_count++;
			}
			if(s[i] != one_start[i]) {
				one_count++;
			}
		}

		System.out.println(Math.min(zero_count, one_count));
	}
}