import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		String s = sc.next();

		int count01 = 0;
		int count10 = 0;

		for (int i = 0; i < s.length(); i++) {
			if (Integer.parseInt(s.substring(i, i + 1)) == i % 2) {
				count01++;
			}
		}
		count10 = s.length() - count01;
		System.out.println(Math.min(count01, count10));

		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 count01 = 0;
		int count10 = 0;

		for (int i = 0; i < s.length(); i++) {
			if (Integer.parseInt(s.substring(i, i + 1)) == i % 2) {
				count01++;
			}
		}
		count10 = s.length() - count01;
		System.out.println(Math.min(count01, count10));

		sc.close();
	}
} Main public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		String s = sc.next();

		int count01 = 0;
		int count10 = 0;

		for (int i = 0; i < s.length(); i++) {
			if (Integer.parseInt(s.substring(i, i + 1)) == i % 2) {
				count01++;
			}
		}
		count10 = s.length() - count01;
		System.out.println(Math.min(count01, count10));

		sc.close();
	} main {

		Scanner sc = new Scanner(System.in);
		String s = sc.next();

		int count01 = 0;
		int count10 = 0;

		for (int i = 0; i < s.length(); i++) {
			if (Integer.parseInt(s.substring(i, i + 1)) == i % 2) {
				count01++;
			}
		}
		count10 = s.length() - count01;
		System.out.println(Math.min(count01, count10));

		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc int count01 = 0; count01 0 int count10 = 0; count10 0 for (int i = 0; i < s.length(); i++) {
			if (Integer.parseInt(s.substring(i, i + 1)) == i % 2) {
				count01++;
			}
		} int i = 0; int i = 0; i 0 i < s.length() i s.length() s.length s i++ i++ i {
			if (Integer.parseInt(s.substring(i, i + 1)) == i % 2) {
				count01++;
			}
		} {
			if (Integer.parseInt(s.substring(i, i + 1)) == i % 2) {
				count01++;
			}
		} if (Integer.parseInt(s.substring(i, i + 1)) == i % 2) {
				count01++;
			} Integer.parseInt(s.substring(i, i + 1)) == i % 2 Integer.parseInt(s.substring(i, i + 1)) Integer.parseInt Integer s.substring(i, i + 1) s.substring s i i + 1 i 1 i % 2 i 2 {
				count01++;
			} count01++ count01 count10 = s.length() - count01 count10 s.length() - count01 s.length() s.length s count01 System.out.println(Math.min(count01, count10)) System.out.println System.out System System.out Math.min(count01, count10) Math.min Math count01 count10 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 count01 = 0;
		int count10 = 0;

		for (int i = 0; i < s.length(); i++) {
			if (Integer.parseInt(s.substring(i, i + 1)) == i % 2) {
				count01++;
			}
		}
		count10 = s.length() - count01;
		System.out.println(Math.min(count01, count10));

		sc.close();
	}
} public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		String s = sc.next();

		int count01 = 0;
		int count10 = 0;

		for (int i = 0; i < s.length(); i++) {
			if (Integer.parseInt(s.substring(i, i + 1)) == i % 2) {
				count01++;
			}
		}
		count10 = s.length() - count01;
		System.out.println(Math.min(count01, count10));

		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 count01 = 0;
		int count10 = 0;

		for (int i = 0; i < s.length(); i++) {
			if (Integer.parseInt(s.substring(i, i + 1)) == i % 2) {
				count01++;
			}
		}
		count10 = s.length() - count01;
		System.out.println(Math.min(count01, count10));

		sc.close();
	}
}