import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] c = sc.next().toCharArray();
		int n = c.length;
		boolean swi = false;
		char[] a = new char[n];
		char[] b = new char[n];
		for (int i = 0; i < n; i++, swi = !swi) {
			a[i] = swi ? '1' : '0';
			b[i] = swi ? '0' : '1';
		}
		int countA = 0;
		int countB = 0;
		for (int i = 0; i < n; i++) {
			if (c[i] != a[i])
				countA++;
		}
		for (int i = 0; i < n; i++) {
			if (c[i] != b[i])
				countB++;
		}
		System.out.println(Math.min(countA, countB));

	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] c = sc.next().toCharArray();
		int n = c.length;
		boolean swi = false;
		char[] a = new char[n];
		char[] b = new char[n];
		for (int i = 0; i < n; i++, swi = !swi) {
			a[i] = swi ? '1' : '0';
			b[i] = swi ? '0' : '1';
		}
		int countA = 0;
		int countB = 0;
		for (int i = 0; i < n; i++) {
			if (c[i] != a[i])
				countA++;
		}
		for (int i = 0; i < n; i++) {
			if (c[i] != b[i])
				countB++;
		}
		System.out.println(Math.min(countA, countB));

	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] c = sc.next().toCharArray();
		int n = c.length;
		boolean swi = false;
		char[] a = new char[n];
		char[] b = new char[n];
		for (int i = 0; i < n; i++, swi = !swi) {
			a[i] = swi ? '1' : '0';
			b[i] = swi ? '0' : '1';
		}
		int countA = 0;
		int countB = 0;
		for (int i = 0; i < n; i++) {
			if (c[i] != a[i])
				countA++;
		}
		for (int i = 0; i < n; i++) {
			if (c[i] != b[i])
				countB++;
		}
		System.out.println(Math.min(countA, countB));

	} main {
		Scanner sc = new Scanner(System.in);
		char[] c = sc.next().toCharArray();
		int n = c.length;
		boolean swi = false;
		char[] a = new char[n];
		char[] b = new char[n];
		for (int i = 0; i < n; i++, swi = !swi) {
			a[i] = swi ? '1' : '0';
			b[i] = swi ? '0' : '1';
		}
		int countA = 0;
		int countB = 0;
		for (int i = 0; i < n; i++) {
			if (c[i] != a[i])
				countA++;
		}
		for (int i = 0; i < n; i++) {
			if (c[i] != b[i])
				countB++;
		}
		System.out.println(Math.min(countA, countB));

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) char[] c = sc.next().toCharArray(); c sc.next().toCharArray() sc.next().toCharArray sc.next() sc.next sc int n = c.length; n c.length c c.length boolean swi = false; swi false char[] a = new char[n]; a new char[n] n char[] b = new char[n]; b new char[n] n for (int i = 0; i < n; i++, swi = !swi) {
			a[i] = swi ? '1' : '0';
			b[i] = swi ? '0' : '1';
		} int i = 0; int i = 0; i 0 i < n i n i++, swi = !swi i++ i swi = !swi swi !swi swi {
			a[i] = swi ? '1' : '0';
			b[i] = swi ? '0' : '1';
		} {
			a[i] = swi ? '1' : '0';
			b[i] = swi ? '0' : '1';
		} a[i] = swi ? '1' : '0' a[i] a i swi ? '1' : '0' swi '1' '0' b[i] = swi ? '0' : '1' b[i] b i swi ? '0' : '1' swi '0' '1' int countA = 0; countA 0 int countB = 0; countB 0 for (int i = 0; i < n; i++) {
			if (c[i] != a[i])
				countA++;
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			if (c[i] != a[i])
				countA++;
		} {
			if (c[i] != a[i])
				countA++;
		} if (c[i] != a[i])
				countA++; c[i] != a[i] c[i] c i a[i] a i countA++ countA for (int i = 0; i < n; i++) {
			if (c[i] != b[i])
				countB++;
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			if (c[i] != b[i])
				countB++;
		} {
			if (c[i] != b[i])
				countB++;
		} if (c[i] != b[i])
				countB++; c[i] != b[i] c[i] c i b[i] b i countB++ countB System.out.println(Math.min(countA, countB)) System.out.println System.out System System.out Math.min(countA, countB) Math.min Math countA countB String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] c = sc.next().toCharArray();
		int n = c.length;
		boolean swi = false;
		char[] a = new char[n];
		char[] b = new char[n];
		for (int i = 0; i < n; i++, swi = !swi) {
			a[i] = swi ? '1' : '0';
			b[i] = swi ? '0' : '1';
		}
		int countA = 0;
		int countB = 0;
		for (int i = 0; i < n; i++) {
			if (c[i] != a[i])
				countA++;
		}
		for (int i = 0; i < n; i++) {
			if (c[i] != b[i])
				countB++;
		}
		System.out.println(Math.min(countA, countB));

	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] c = sc.next().toCharArray();
		int n = c.length;
		boolean swi = false;
		char[] a = new char[n];
		char[] b = new char[n];
		for (int i = 0; i < n; i++, swi = !swi) {
			a[i] = swi ? '1' : '0';
			b[i] = swi ? '0' : '1';
		}
		int countA = 0;
		int countB = 0;
		for (int i = 0; i < n; i++) {
			if (c[i] != a[i])
				countA++;
		}
		for (int i = 0; i < n; i++) {
			if (c[i] != b[i])
				countB++;
		}
		System.out.println(Math.min(countA, countB));

	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] c = sc.next().toCharArray();
		int n = c.length;
		boolean swi = false;
		char[] a = new char[n];
		char[] b = new char[n];
		for (int i = 0; i < n; i++, swi = !swi) {
			a[i] = swi ? '1' : '0';
			b[i] = swi ? '0' : '1';
		}
		int countA = 0;
		int countB = 0;
		for (int i = 0; i < n; i++) {
			if (c[i] != a[i])
				countA++;
		}
		for (int i = 0; i < n; i++) {
			if (c[i] != b[i])
				countB++;
		}
		System.out.println(Math.min(countA, countB));

	}

}
