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 res = 0;
		
		for(int i = 1; i < c.length; i++) {
			if(c[i] == c[i-1]) {
				c[i] = c[i-1] == '0' ? '1' : '0';
				res++;
			}
		}
		System.out.println(res);
	}
} 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 res = 0;
		
		for(int i = 1; i < c.length; i++) {
			if(c[i] == c[i-1]) {
				c[i] = c[i-1] == '0' ? '1' : '0';
				res++;
			}
		}
		System.out.println(res);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		char[] c = sc.next().toCharArray();
		
		int res = 0;
		
		for(int i = 1; i < c.length; i++) {
			if(c[i] == c[i-1]) {
				c[i] = c[i-1] == '0' ? '1' : '0';
				res++;
			}
		}
		System.out.println(res);
	} main {
		Scanner sc = new Scanner(System.in);
		
		char[] c = sc.next().toCharArray();
		
		int res = 0;
		
		for(int i = 1; i < c.length; i++) {
			if(c[i] == c[i-1]) {
				c[i] = c[i-1] == '0' ? '1' : '0';
				res++;
			}
		}
		System.out.println(res);
	} 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 res = 0; res 0 for(int i = 1; i < c.length; i++) {
			if(c[i] == c[i-1]) {
				c[i] = c[i-1] == '0' ? '1' : '0';
				res++;
			}
		} int i = 1; int i = 1; i 1 i < c.length i c.length c c.length i++ i++ i {
			if(c[i] == c[i-1]) {
				c[i] = c[i-1] == '0' ? '1' : '0';
				res++;
			}
		} {
			if(c[i] == c[i-1]) {
				c[i] = c[i-1] == '0' ? '1' : '0';
				res++;
			}
		} if(c[i] == c[i-1]) {
				c[i] = c[i-1] == '0' ? '1' : '0';
				res++;
			} c[i] == c[i-1] c[i] c i c[i-1] c i-1 i 1 {
				c[i] = c[i-1] == '0' ? '1' : '0';
				res++;
			} c[i] = c[i-1] == '0' ? '1' : '0' c[i] c i c[i-1] == '0' ? '1' : '0' c[i-1] == '0' c[i-1] c i-1 i 1 '0' '1' '0' res++ res System.out.println(res) System.out.println System.out System System.out res String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		char[] c = sc.next().toCharArray();
		
		int res = 0;
		
		for(int i = 1; i < c.length; i++) {
			if(c[i] == c[i-1]) {
				c[i] = c[i-1] == '0' ? '1' : '0';
				res++;
			}
		}
		System.out.println(res);
	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		char[] c = sc.next().toCharArray();
		
		int res = 0;
		
		for(int i = 1; i < c.length; i++) {
			if(c[i] == c[i-1]) {
				c[i] = c[i-1] == '0' ? '1' : '0';
				res++;
			}
		}
		System.out.println(res);
	}
} 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 res = 0;
		
		for(int i = 1; i < c.length; i++) {
			if(c[i] == c[i-1]) {
				c[i] = c[i-1] == '0' ? '1' : '0';
				res++;
			}
		}
		System.out.println(res);
	}
}
