import java.util.Scanner;

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

		// starts with zero
		for(int i = 0; i < S.length(); i++) {
			if(i % 2 == 0) {
				start_zero += (S.charAt(i) == '0') ? 0 : 1;
			}
			else {
				start_zero += (S.charAt(i) == '1') ? 0 : 1;
			}
		}

		// starts with one
		for(int i = 0; i < S.length(); i++) {
			if(i % 2 == 0) {
				start_one += (S.charAt(i) == '1') ? 0 : 1;
			}
			else {
				start_one += (S.charAt(i) == '0') ? 0 : 1;
			}
		}

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

		// starts with zero
		for(int i = 0; i < S.length(); i++) {
			if(i % 2 == 0) {
				start_zero += (S.charAt(i) == '0') ? 0 : 1;
			}
			else {
				start_zero += (S.charAt(i) == '1') ? 0 : 1;
			}
		}

		// starts with one
		for(int i = 0; i < S.length(); i++) {
			if(i % 2 == 0) {
				start_one += (S.charAt(i) == '1') ? 0 : 1;
			}
			else {
				start_one += (S.charAt(i) == '0') ? 0 : 1;
			}
		}

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

		// starts with zero
		for(int i = 0; i < S.length(); i++) {
			if(i % 2 == 0) {
				start_zero += (S.charAt(i) == '0') ? 0 : 1;
			}
			else {
				start_zero += (S.charAt(i) == '1') ? 0 : 1;
			}
		}

		// starts with one
		for(int i = 0; i < S.length(); i++) {
			if(i % 2 == 0) {
				start_one += (S.charAt(i) == '1') ? 0 : 1;
			}
			else {
				start_one += (S.charAt(i) == '0') ? 0 : 1;
			}
		}

		System.out.println(Math.min(start_one, start_zero));
	} main {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		int start_zero = 0, start_one = 0;

		// starts with zero
		for(int i = 0; i < S.length(); i++) {
			if(i % 2 == 0) {
				start_zero += (S.charAt(i) == '0') ? 0 : 1;
			}
			else {
				start_zero += (S.charAt(i) == '1') ? 0 : 1;
			}
		}

		// starts with one
		for(int i = 0; i < S.length(); i++) {
			if(i % 2 == 0) {
				start_one += (S.charAt(i) == '1') ? 0 : 1;
			}
			else {
				start_one += (S.charAt(i) == '0') ? 0 : 1;
			}
		}

		System.out.println(Math.min(start_one, start_zero));
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.next(); S sc.next() sc.next sc int start_zero = 0 start_zero 0 start_one = 0; start_one 0 for(int i = 0; i < S.length(); i++) {
			if(i % 2 == 0) {
				start_zero += (S.charAt(i) == '0') ? 0 : 1;
			}
			else {
				start_zero += (S.charAt(i) == '1') ? 0 : 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) {
				start_zero += (S.charAt(i) == '0') ? 0 : 1;
			}
			else {
				start_zero += (S.charAt(i) == '1') ? 0 : 1;
			}
		} {
			if(i % 2 == 0) {
				start_zero += (S.charAt(i) == '0') ? 0 : 1;
			}
			else {
				start_zero += (S.charAt(i) == '1') ? 0 : 1;
			}
		} if(i % 2 == 0) {
				start_zero += (S.charAt(i) == '0') ? 0 : 1;
			}
			else {
				start_zero += (S.charAt(i) == '1') ? 0 : 1;
			} i % 2 == 0 i % 2 i 2 0 {
				start_zero += (S.charAt(i) == '0') ? 0 : 1;
			} start_zero += (S.charAt(i) == '0') ? 0 : 1 start_zero (S.charAt(i) == '0') ? 0 : 1 (S.charAt(i) == '0') S.charAt(i) S.charAt S i '0' 0 1 {
				start_zero += (S.charAt(i) == '1') ? 0 : 1;
			} start_zero += (S.charAt(i) == '1') ? 0 : 1 start_zero (S.charAt(i) == '1') ? 0 : 1 (S.charAt(i) == '1') S.charAt(i) S.charAt S i '1' 0 1 for(int i = 0; i < S.length(); i++) {
			if(i % 2 == 0) {
				start_one += (S.charAt(i) == '1') ? 0 : 1;
			}
			else {
				start_one += (S.charAt(i) == '0') ? 0 : 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) {
				start_one += (S.charAt(i) == '1') ? 0 : 1;
			}
			else {
				start_one += (S.charAt(i) == '0') ? 0 : 1;
			}
		} {
			if(i % 2 == 0) {
				start_one += (S.charAt(i) == '1') ? 0 : 1;
			}
			else {
				start_one += (S.charAt(i) == '0') ? 0 : 1;
			}
		} if(i % 2 == 0) {
				start_one += (S.charAt(i) == '1') ? 0 : 1;
			}
			else {
				start_one += (S.charAt(i) == '0') ? 0 : 1;
			} i % 2 == 0 i % 2 i 2 0 {
				start_one += (S.charAt(i) == '1') ? 0 : 1;
			} start_one += (S.charAt(i) == '1') ? 0 : 1 start_one (S.charAt(i) == '1') ? 0 : 1 (S.charAt(i) == '1') S.charAt(i) S.charAt S i '1' 0 1 {
				start_one += (S.charAt(i) == '0') ? 0 : 1;
			} start_one += (S.charAt(i) == '0') ? 0 : 1 start_one (S.charAt(i) == '0') ? 0 : 1 (S.charAt(i) == '0') S.charAt(i) S.charAt S i '0' 0 1 System.out.println(Math.min(start_one, start_zero)) System.out.println System.out System System.out Math.min(start_one, start_zero) Math.min Math start_one start_zero String[] args args
import java.util.Scanner;

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

		// starts with zero
		for(int i = 0; i < S.length(); i++) {
			if(i % 2 == 0) {
				start_zero += (S.charAt(i) == '0') ? 0 : 1;
			}
			else {
				start_zero += (S.charAt(i) == '1') ? 0 : 1;
			}
		}

		// starts with one
		for(int i = 0; i < S.length(); i++) {
			if(i % 2 == 0) {
				start_one += (S.charAt(i) == '1') ? 0 : 1;
			}
			else {
				start_one += (S.charAt(i) == '0') ? 0 : 1;
			}
		}

		System.out.println(Math.min(start_one, start_zero));
	}
}