
import java.io.*;
import java.util.*;

public class Main {

	public static void main(String[] args) throws IOException {

		Scanner sc = new Scanner(System.in);
		String input = sc.next();
		String split[] = input.split("");
		int n = input.length();
		int in[] = new int[n];
		int count1 =0;
		int count2 =0;
		for(int i =0;i<n;i++) {
			in[i] = Integer.parseInt(split[i]);
		}

		for(int j =0;j<n;j++) {
			if(j%2==0) {
				if(in[j]==1) {
					count1++;
				}
			}else {
				if(in[j]==0) {
					count1++;
				}
			}
		}

		for(int k =0;k<n;k++) {
			if(k%2==0) {
				if(in[k]==0) {
					count2++;
				}
			}else {
				if(in[k]==1) {
					count2++;
				}
			}
		}
		if(count2>=count1) {
			System.out.println(count1);
		}else {
			System.out.println(count2);
		}
	}

} import java.io.*; io.* java import java.util.*; util.* java public class Main {

	public static void main(String[] args) throws IOException {

		Scanner sc = new Scanner(System.in);
		String input = sc.next();
		String split[] = input.split("");
		int n = input.length();
		int in[] = new int[n];
		int count1 =0;
		int count2 =0;
		for(int i =0;i<n;i++) {
			in[i] = Integer.parseInt(split[i]);
		}

		for(int j =0;j<n;j++) {
			if(j%2==0) {
				if(in[j]==1) {
					count1++;
				}
			}else {
				if(in[j]==0) {
					count1++;
				}
			}
		}

		for(int k =0;k<n;k++) {
			if(k%2==0) {
				if(in[k]==0) {
					count2++;
				}
			}else {
				if(in[k]==1) {
					count2++;
				}
			}
		}
		if(count2>=count1) {
			System.out.println(count1);
		}else {
			System.out.println(count2);
		}
	}

} Main public static void main(String[] args) throws IOException {

		Scanner sc = new Scanner(System.in);
		String input = sc.next();
		String split[] = input.split("");
		int n = input.length();
		int in[] = new int[n];
		int count1 =0;
		int count2 =0;
		for(int i =0;i<n;i++) {
			in[i] = Integer.parseInt(split[i]);
		}

		for(int j =0;j<n;j++) {
			if(j%2==0) {
				if(in[j]==1) {
					count1++;
				}
			}else {
				if(in[j]==0) {
					count1++;
				}
			}
		}

		for(int k =0;k<n;k++) {
			if(k%2==0) {
				if(in[k]==0) {
					count2++;
				}
			}else {
				if(in[k]==1) {
					count2++;
				}
			}
		}
		if(count2>=count1) {
			System.out.println(count1);
		}else {
			System.out.println(count2);
		}
	} main {

		Scanner sc = new Scanner(System.in);
		String input = sc.next();
		String split[] = input.split("");
		int n = input.length();
		int in[] = new int[n];
		int count1 =0;
		int count2 =0;
		for(int i =0;i<n;i++) {
			in[i] = Integer.parseInt(split[i]);
		}

		for(int j =0;j<n;j++) {
			if(j%2==0) {
				if(in[j]==1) {
					count1++;
				}
			}else {
				if(in[j]==0) {
					count1++;
				}
			}
		}

		for(int k =0;k<n;k++) {
			if(k%2==0) {
				if(in[k]==0) {
					count2++;
				}
			}else {
				if(in[k]==1) {
					count2++;
				}
			}
		}
		if(count2>=count1) {
			System.out.println(count1);
		}else {
			System.out.println(count2);
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String input = sc.next(); input sc.next() sc.next sc String split[] = input.split(""); split input.split("") input.split input "" int n = input.length(); n input.length() input.length input int in[] = new int[n]; in new int[n] n int count1 =0; count1 0 int count2 =0; count2 0 for(int i =0;i<n;i++) {
			in[i] = Integer.parseInt(split[i]);
		} int i =0; int i =0; i 0 i<n i n i++ i++ i {
			in[i] = Integer.parseInt(split[i]);
		} {
			in[i] = Integer.parseInt(split[i]);
		} in[i] = Integer.parseInt(split[i]) in[i] in i Integer.parseInt(split[i]) Integer.parseInt Integer split[i] split i for(int j =0;j<n;j++) {
			if(j%2==0) {
				if(in[j]==1) {
					count1++;
				}
			}else {
				if(in[j]==0) {
					count1++;
				}
			}
		} int j =0; int j =0; j 0 j<n j n j++ j++ j {
			if(j%2==0) {
				if(in[j]==1) {
					count1++;
				}
			}else {
				if(in[j]==0) {
					count1++;
				}
			}
		} {
			if(j%2==0) {
				if(in[j]==1) {
					count1++;
				}
			}else {
				if(in[j]==0) {
					count1++;
				}
			}
		} if(j%2==0) {
				if(in[j]==1) {
					count1++;
				}
			}else {
				if(in[j]==0) {
					count1++;
				}
			} j%2==0 j%2 j 2 0 {
				if(in[j]==1) {
					count1++;
				}
			} if(in[j]==1) {
					count1++;
				} in[j]==1 in[j] in j 1 {
					count1++;
				} count1++ count1 {
				if(in[j]==0) {
					count1++;
				}
			} if(in[j]==0) {
					count1++;
				} in[j]==0 in[j] in j 0 {
					count1++;
				} count1++ count1 for(int k =0;k<n;k++) {
			if(k%2==0) {
				if(in[k]==0) {
					count2++;
				}
			}else {
				if(in[k]==1) {
					count2++;
				}
			}
		} int k =0; int k =0; k 0 k<n k n k++ k++ k {
			if(k%2==0) {
				if(in[k]==0) {
					count2++;
				}
			}else {
				if(in[k]==1) {
					count2++;
				}
			}
		} {
			if(k%2==0) {
				if(in[k]==0) {
					count2++;
				}
			}else {
				if(in[k]==1) {
					count2++;
				}
			}
		} if(k%2==0) {
				if(in[k]==0) {
					count2++;
				}
			}else {
				if(in[k]==1) {
					count2++;
				}
			} k%2==0 k%2 k 2 0 {
				if(in[k]==0) {
					count2++;
				}
			} if(in[k]==0) {
					count2++;
				} in[k]==0 in[k] in k 0 {
					count2++;
				} count2++ count2 {
				if(in[k]==1) {
					count2++;
				}
			} if(in[k]==1) {
					count2++;
				} in[k]==1 in[k] in k 1 {
					count2++;
				} count2++ count2 if(count2>=count1) {
			System.out.println(count1);
		}else {
			System.out.println(count2);
		} count2>=count1 count2 count1 {
			System.out.println(count1);
		} System.out.println(count1) System.out.println System.out System System.out count1 {
			System.out.println(count2);
		} System.out.println(count2) System.out.println System.out System System.out count2 String[] args args public class Main {

	public static void main(String[] args) throws IOException {

		Scanner sc = new Scanner(System.in);
		String input = sc.next();
		String split[] = input.split("");
		int n = input.length();
		int in[] = new int[n];
		int count1 =0;
		int count2 =0;
		for(int i =0;i<n;i++) {
			in[i] = Integer.parseInt(split[i]);
		}

		for(int j =0;j<n;j++) {
			if(j%2==0) {
				if(in[j]==1) {
					count1++;
				}
			}else {
				if(in[j]==0) {
					count1++;
				}
			}
		}

		for(int k =0;k<n;k++) {
			if(k%2==0) {
				if(in[k]==0) {
					count2++;
				}
			}else {
				if(in[k]==1) {
					count2++;
				}
			}
		}
		if(count2>=count1) {
			System.out.println(count1);
		}else {
			System.out.println(count2);
		}
	}

} public class Main {

	public static void main(String[] args) throws IOException {

		Scanner sc = new Scanner(System.in);
		String input = sc.next();
		String split[] = input.split("");
		int n = input.length();
		int in[] = new int[n];
		int count1 =0;
		int count2 =0;
		for(int i =0;i<n;i++) {
			in[i] = Integer.parseInt(split[i]);
		}

		for(int j =0;j<n;j++) {
			if(j%2==0) {
				if(in[j]==1) {
					count1++;
				}
			}else {
				if(in[j]==0) {
					count1++;
				}
			}
		}

		for(int k =0;k<n;k++) {
			if(k%2==0) {
				if(in[k]==0) {
					count2++;
				}
			}else {
				if(in[k]==1) {
					count2++;
				}
			}
		}
		if(count2>=count1) {
			System.out.println(count1);
		}else {
			System.out.println(count2);
		}
	}

} Main

import java.io.*;
import java.util.*;

public class Main {

	public static void main(String[] args) throws IOException {

		Scanner sc = new Scanner(System.in);
		String input = sc.next();
		String split[] = input.split("");
		int n = input.length();
		int in[] = new int[n];
		int count1 =0;
		int count2 =0;
		for(int i =0;i<n;i++) {
			in[i] = Integer.parseInt(split[i]);
		}

		for(int j =0;j<n;j++) {
			if(j%2==0) {
				if(in[j]==1) {
					count1++;
				}
			}else {
				if(in[j]==0) {
					count1++;
				}
			}
		}

		for(int k =0;k<n;k++) {
			if(k%2==0) {
				if(in[k]==0) {
					count2++;
				}
			}else {
				if(in[k]==1) {
					count2++;
				}
			}
		}
		if(count2>=count1) {
			System.out.println(count1);
		}else {
			System.out.println(count2);
		}
	}

}
