import java.util.Scanner;

public class Main
{

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

		String s = sc.next();
		//int num = Integer.parseInt(s, 2);

		int whitefirst = 0;

		for (int i = 0; i < s.length(); i++) {
			if (s.charAt(i) - '0' == i % 2) {
				whitefirst++;
			}
		}

		int blackfirst = 0;

		for (int i = 0; i < s.length(); i++) {
			if (s.charAt(i) - '0' != i % 2) {
				blackfirst++;
			}
		}

		System.out.println(Math.min(whitefirst, blackfirst));
		sc.close();
	}
} import java.util.Scanner; Scanner java.util public class Main
{

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

		String s = sc.next();
		//int num = Integer.parseInt(s, 2);

		int whitefirst = 0;

		for (int i = 0; i < s.length(); i++) {
			if (s.charAt(i) - '0' == i % 2) {
				whitefirst++;
			}
		}

		int blackfirst = 0;

		for (int i = 0; i < s.length(); i++) {
			if (s.charAt(i) - '0' != i % 2) {
				blackfirst++;
			}
		}

		System.out.println(Math.min(whitefirst, blackfirst));
		sc.close();
	}
} Main public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);

		String s = sc.next();
		//int num = Integer.parseInt(s, 2);

		int whitefirst = 0;

		for (int i = 0; i < s.length(); i++) {
			if (s.charAt(i) - '0' == i % 2) {
				whitefirst++;
			}
		}

		int blackfirst = 0;

		for (int i = 0; i < s.length(); i++) {
			if (s.charAt(i) - '0' != i % 2) {
				blackfirst++;
			}
		}

		System.out.println(Math.min(whitefirst, blackfirst));
		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);

		String s = sc.next();
		//int num = Integer.parseInt(s, 2);

		int whitefirst = 0;

		for (int i = 0; i < s.length(); i++) {
			if (s.charAt(i) - '0' == i % 2) {
				whitefirst++;
			}
		}

		int blackfirst = 0;

		for (int i = 0; i < s.length(); i++) {
			if (s.charAt(i) - '0' != i % 2) {
				blackfirst++;
			}
		}

		System.out.println(Math.min(whitefirst, blackfirst));
		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc int whitefirst = 0; whitefirst 0 for (int i = 0; i < s.length(); i++) {
			if (s.charAt(i) - '0' == i % 2) {
				whitefirst++;
			}
		} int i = 0; int i = 0; i 0 i < s.length() i s.length() s.length s i++ i++ i {
			if (s.charAt(i) - '0' == i % 2) {
				whitefirst++;
			}
		} {
			if (s.charAt(i) - '0' == i % 2) {
				whitefirst++;
			}
		} if (s.charAt(i) - '0' == i % 2) {
				whitefirst++;
			} s.charAt(i) - '0' == i % 2 s.charAt(i) - '0' s.charAt(i) s.charAt s i '0' i % 2 i 2 {
				whitefirst++;
			} whitefirst++ whitefirst int blackfirst = 0; blackfirst 0 for (int i = 0; i < s.length(); i++) {
			if (s.charAt(i) - '0' != i % 2) {
				blackfirst++;
			}
		} int i = 0; int i = 0; i 0 i < s.length() i s.length() s.length s i++ i++ i {
			if (s.charAt(i) - '0' != i % 2) {
				blackfirst++;
			}
		} {
			if (s.charAt(i) - '0' != i % 2) {
				blackfirst++;
			}
		} if (s.charAt(i) - '0' != i % 2) {
				blackfirst++;
			} s.charAt(i) - '0' != i % 2 s.charAt(i) - '0' s.charAt(i) s.charAt s i '0' i % 2 i 2 {
				blackfirst++;
			} blackfirst++ blackfirst System.out.println(Math.min(whitefirst, blackfirst)) System.out.println System.out System System.out Math.min(whitefirst, blackfirst) Math.min Math whitefirst blackfirst sc.close() sc.close sc String[] args args public class Main
{

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

		String s = sc.next();
		//int num = Integer.parseInt(s, 2);

		int whitefirst = 0;

		for (int i = 0; i < s.length(); i++) {
			if (s.charAt(i) - '0' == i % 2) {
				whitefirst++;
			}
		}

		int blackfirst = 0;

		for (int i = 0; i < s.length(); i++) {
			if (s.charAt(i) - '0' != i % 2) {
				blackfirst++;
			}
		}

		System.out.println(Math.min(whitefirst, blackfirst));
		sc.close();
	}
} public class Main
{

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

		String s = sc.next();
		//int num = Integer.parseInt(s, 2);

		int whitefirst = 0;

		for (int i = 0; i < s.length(); i++) {
			if (s.charAt(i) - '0' == i % 2) {
				whitefirst++;
			}
		}

		int blackfirst = 0;

		for (int i = 0; i < s.length(); i++) {
			if (s.charAt(i) - '0' != i % 2) {
				blackfirst++;
			}
		}

		System.out.println(Math.min(whitefirst, blackfirst));
		sc.close();
	}
} Main
import java.util.Scanner;

public class Main
{

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

		String s = sc.next();
		//int num = Integer.parseInt(s, 2);

		int whitefirst = 0;

		for (int i = 0; i < s.length(); i++) {
			if (s.charAt(i) - '0' == i % 2) {
				whitefirst++;
			}
		}

		int blackfirst = 0;

		for (int i = 0; i < s.length(); i++) {
			if (s.charAt(i) - '0' != i % 2) {
				blackfirst++;
			}
		}

		System.out.println(Math.min(whitefirst, blackfirst));
		sc.close();
	}
}