import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str[] = br.readLine().split("");

		String s1[] = new String[str.length];
		String s2[] = new String[str.length];

		for (int i = 0; i < str.length; i++) {
			s1[i] = String.valueOf(i % 2);
			s2[i] = String.valueOf((i + 1) % 2);
		}

		int count1 = 0;
		int count2 = 0;

		for (int i = 0; i < str.length; i++) {
			if (!str[i].equals(s1[i])) {
				count1++;
			}
			if (!str[i].equals(s2[i])) {
				count2++;
			}
		}

		System.out.println(Math.min(count1, count2));
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.Arrays; Arrays java.util import java.util.HashSet; HashSet java.util import java.util.Set; Set java.util public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str[] = br.readLine().split("");

		String s1[] = new String[str.length];
		String s2[] = new String[str.length];

		for (int i = 0; i < str.length; i++) {
			s1[i] = String.valueOf(i % 2);
			s2[i] = String.valueOf((i + 1) % 2);
		}

		int count1 = 0;
		int count2 = 0;

		for (int i = 0; i < str.length; i++) {
			if (!str[i].equals(s1[i])) {
				count1++;
			}
			if (!str[i].equals(s2[i])) {
				count2++;
			}
		}

		System.out.println(Math.min(count1, count2));
	}
} Main public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str[] = br.readLine().split("");

		String s1[] = new String[str.length];
		String s2[] = new String[str.length];

		for (int i = 0; i < str.length; i++) {
			s1[i] = String.valueOf(i % 2);
			s2[i] = String.valueOf((i + 1) % 2);
		}

		int count1 = 0;
		int count2 = 0;

		for (int i = 0; i < str.length; i++) {
			if (!str[i].equals(s1[i])) {
				count1++;
			}
			if (!str[i].equals(s2[i])) {
				count2++;
			}
		}

		System.out.println(Math.min(count1, count2));
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str[] = br.readLine().split("");

		String s1[] = new String[str.length];
		String s2[] = new String[str.length];

		for (int i = 0; i < str.length; i++) {
			s1[i] = String.valueOf(i % 2);
			s2[i] = String.valueOf((i + 1) % 2);
		}

		int count1 = 0;
		int count2 = 0;

		for (int i = 0; i < str.length; i++) {
			if (!str[i].equals(s1[i])) {
				count1++;
			}
			if (!str[i].equals(s2[i])) {
				count2++;
			}
		}

		System.out.println(Math.min(count1, count2));
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String str[] = br.readLine().split(""); str br.readLine().split("") br.readLine().split br.readLine() br.readLine br "" String s1[] = new String[str.length]; s1 new String[str.length] str.length str str.length String s2[] = new String[str.length]; s2 new String[str.length] str.length str str.length for (int i = 0; i < str.length; i++) {
			s1[i] = String.valueOf(i % 2);
			s2[i] = String.valueOf((i + 1) % 2);
		} int i = 0; int i = 0; i 0 i < str.length i str.length str str.length i++ i++ i {
			s1[i] = String.valueOf(i % 2);
			s2[i] = String.valueOf((i + 1) % 2);
		} {
			s1[i] = String.valueOf(i % 2);
			s2[i] = String.valueOf((i + 1) % 2);
		} s1[i] = String.valueOf(i % 2) s1[i] s1 i String.valueOf(i % 2) String.valueOf String i % 2 i 2 s2[i] = String.valueOf((i + 1) % 2) s2[i] s2 i String.valueOf((i + 1) % 2) String.valueOf String (i + 1) % 2 (i + 1) i 1 2 int count1 = 0; count1 0 int count2 = 0; count2 0 for (int i = 0; i < str.length; i++) {
			if (!str[i].equals(s1[i])) {
				count1++;
			}
			if (!str[i].equals(s2[i])) {
				count2++;
			}
		} int i = 0; int i = 0; i 0 i < str.length i str.length str str.length i++ i++ i {
			if (!str[i].equals(s1[i])) {
				count1++;
			}
			if (!str[i].equals(s2[i])) {
				count2++;
			}
		} {
			if (!str[i].equals(s1[i])) {
				count1++;
			}
			if (!str[i].equals(s2[i])) {
				count2++;
			}
		} if (!str[i].equals(s1[i])) {
				count1++;
			} !str[i].equals(s1[i]) str[i].equals(s1[i]) str[i].equals str[i] str i s1[i] s1 i {
				count1++;
			} count1++ count1 if (!str[i].equals(s2[i])) {
				count2++;
			} !str[i].equals(s2[i]) str[i].equals(s2[i]) str[i].equals str[i] str i s2[i] s2 i {
				count2++;
			} count2++ count2 System.out.println(Math.min(count1, count2)) System.out.println System.out System System.out Math.min(count1, count2) Math.min Math count1 count2 String[] args args public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str[] = br.readLine().split("");

		String s1[] = new String[str.length];
		String s2[] = new String[str.length];

		for (int i = 0; i < str.length; i++) {
			s1[i] = String.valueOf(i % 2);
			s2[i] = String.valueOf((i + 1) % 2);
		}

		int count1 = 0;
		int count2 = 0;

		for (int i = 0; i < str.length; i++) {
			if (!str[i].equals(s1[i])) {
				count1++;
			}
			if (!str[i].equals(s2[i])) {
				count2++;
			}
		}

		System.out.println(Math.min(count1, count2));
	}
} public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str[] = br.readLine().split("");

		String s1[] = new String[str.length];
		String s2[] = new String[str.length];

		for (int i = 0; i < str.length; i++) {
			s1[i] = String.valueOf(i % 2);
			s2[i] = String.valueOf((i + 1) % 2);
		}

		int count1 = 0;
		int count2 = 0;

		for (int i = 0; i < str.length; i++) {
			if (!str[i].equals(s1[i])) {
				count1++;
			}
			if (!str[i].equals(s2[i])) {
				count2++;
			}
		}

		System.out.println(Math.min(count1, count2));
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str[] = br.readLine().split("");

		String s1[] = new String[str.length];
		String s2[] = new String[str.length];

		for (int i = 0; i < str.length; i++) {
			s1[i] = String.valueOf(i % 2);
			s2[i] = String.valueOf((i + 1) % 2);
		}

		int count1 = 0;
		int count2 = 0;

		for (int i = 0; i < str.length; i++) {
			if (!str[i].equals(s1[i])) {
				count1++;
			}
			if (!str[i].equals(s2[i])) {
				count2++;
			}
		}

		System.out.println(Math.min(count1, count2));
	}
}