import java.util.*;

public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] arr = sc.next().toCharArray();
		int count = 0;
		for (int i = 0; i < arr.length; i++) {
		    if (i % 2 == 0 ^ arr[i] == '0') {
		        count++;
		    }
		}
		System.out.println(Math.min(count, arr.length - count));
   }
} import java.util.*; util.* java public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] arr = sc.next().toCharArray();
		int count = 0;
		for (int i = 0; i < arr.length; i++) {
		    if (i % 2 == 0 ^ arr[i] == '0') {
		        count++;
		    }
		}
		System.out.println(Math.min(count, arr.length - count));
   }
} Main public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] arr = sc.next().toCharArray();
		int count = 0;
		for (int i = 0; i < arr.length; i++) {
		    if (i % 2 == 0 ^ arr[i] == '0') {
		        count++;
		    }
		}
		System.out.println(Math.min(count, arr.length - count));
   } main {
		Scanner sc = new Scanner(System.in);
		char[] arr = sc.next().toCharArray();
		int count = 0;
		for (int i = 0; i < arr.length; i++) {
		    if (i % 2 == 0 ^ arr[i] == '0') {
		        count++;
		    }
		}
		System.out.println(Math.min(count, arr.length - count));
   } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) char[] arr = sc.next().toCharArray(); arr sc.next().toCharArray() sc.next().toCharArray sc.next() sc.next sc int count = 0; count 0 for (int i = 0; i < arr.length; i++) {
		    if (i % 2 == 0 ^ arr[i] == '0') {
		        count++;
		    }
		} int i = 0; int i = 0; i 0 i < arr.length i arr.length arr arr.length i++ i++ i {
		    if (i % 2 == 0 ^ arr[i] == '0') {
		        count++;
		    }
		} {
		    if (i % 2 == 0 ^ arr[i] == '0') {
		        count++;
		    }
		} if (i % 2 == 0 ^ arr[i] == '0') {
		        count++;
		    } i % 2 == 0 ^ arr[i] == '0' i % 2 == 0 i % 2 i 2 0 arr[i] == '0' arr[i] arr i '0' {
		        count++;
		    } count++ count System.out.println(Math.min(count, arr.length - count)) System.out.println System.out System System.out Math.min(count, arr.length - count) Math.min Math count arr.length - count arr.length arr arr.length count String[] args args public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] arr = sc.next().toCharArray();
		int count = 0;
		for (int i = 0; i < arr.length; i++) {
		    if (i % 2 == 0 ^ arr[i] == '0') {
		        count++;
		    }
		}
		System.out.println(Math.min(count, arr.length - count));
   }
} public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] arr = sc.next().toCharArray();
		int count = 0;
		for (int i = 0; i < arr.length; i++) {
		    if (i % 2 == 0 ^ arr[i] == '0') {
		        count++;
		    }
		}
		System.out.println(Math.min(count, arr.length - count));
   }
} Main
import java.util.*;

public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] arr = sc.next().toCharArray();
		int count = 0;
		for (int i = 0; i < arr.length; i++) {
		    if (i % 2 == 0 ^ arr[i] == '0') {
		        count++;
		    }
		}
		System.out.println(Math.min(count, arr.length - count));
   }
}
