import java.util.Scanner;

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

		int A = 0;
		int B = 0;

		for (int i = 0; i < arr.length; i++) {
			if (arr[i] == '0' ^ i % 2 == 0) {
				A++;
			} else {
				B++;
			}
		}
		System.out.println(Math.min(A, B));

	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] arr = sc.next().toCharArray();

		int A = 0;
		int B = 0;

		for (int i = 0; i < arr.length; i++) {
			if (arr[i] == '0' ^ i % 2 == 0) {
				A++;
			} else {
				B++;
			}
		}
		System.out.println(Math.min(A, B));

	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] arr = sc.next().toCharArray();

		int A = 0;
		int B = 0;

		for (int i = 0; i < arr.length; i++) {
			if (arr[i] == '0' ^ i % 2 == 0) {
				A++;
			} else {
				B++;
			}
		}
		System.out.println(Math.min(A, B));

	} main {
		Scanner sc = new Scanner(System.in);
		char[] arr = sc.next().toCharArray();

		int A = 0;
		int B = 0;

		for (int i = 0; i < arr.length; i++) {
			if (arr[i] == '0' ^ i % 2 == 0) {
				A++;
			} else {
				B++;
			}
		}
		System.out.println(Math.min(A, B));

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) char[] arr = sc.next().toCharArray(); arr sc.next().toCharArray() sc.next().toCharArray sc.next() sc.next sc int A = 0; A 0 int B = 0; B 0 for (int i = 0; i < arr.length; i++) {
			if (arr[i] == '0' ^ i % 2 == 0) {
				A++;
			} else {
				B++;
			}
		} int i = 0; int i = 0; i 0 i < arr.length i arr.length arr arr.length i++ i++ i {
			if (arr[i] == '0' ^ i % 2 == 0) {
				A++;
			} else {
				B++;
			}
		} {
			if (arr[i] == '0' ^ i % 2 == 0) {
				A++;
			} else {
				B++;
			}
		} if (arr[i] == '0' ^ i % 2 == 0) {
				A++;
			} else {
				B++;
			} arr[i] == '0' ^ i % 2 == 0 arr[i] == '0' arr[i] arr i '0' i % 2 == 0 i % 2 i 2 0 {
				A++;
			} A++ A {
				B++;
			} B++ B System.out.println(Math.min(A, B)) System.out.println System.out System System.out Math.min(A, B) Math.min Math A B String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] arr = sc.next().toCharArray();

		int A = 0;
		int B = 0;

		for (int i = 0; i < arr.length; i++) {
			if (arr[i] == '0' ^ i % 2 == 0) {
				A++;
			} else {
				B++;
			}
		}
		System.out.println(Math.min(A, B));

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

		int A = 0;
		int B = 0;

		for (int i = 0; i < arr.length; i++) {
			if (arr[i] == '0' ^ i % 2 == 0) {
				A++;
			} else {
				B++;
			}
		}
		System.out.println(Math.min(A, B));

	}
} Main
import java.util.Scanner;

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

		int A = 0;
		int B = 0;

		for (int i = 0; i < arr.length; i++) {
			if (arr[i] == '0' ^ i % 2 == 0) {
				A++;
			} else {
				B++;
			}
		}
		System.out.println(Math.min(A, B));

	}
}