
import java.util.Scanner;

class Main {
	public static void main(String[]args) {
		Scanner scan = new Scanner(System.in);
		char []ch = scan.next().toCharArray();
		int count = 0 ;
		for(int i = 1 ; i<ch.length ; i++) {
			if(ch[i]==ch[i-1]) {
				count++;
				if(ch[i-1] == '0')
					ch[i] = '1';
				else
					ch[i] = '0' ;
			}
		}
		System.out.println(count);
	}
} import java.util.Scanner; Scanner java.util class Main {
	public static void main(String[]args) {
		Scanner scan = new Scanner(System.in);
		char []ch = scan.next().toCharArray();
		int count = 0 ;
		for(int i = 1 ; i<ch.length ; i++) {
			if(ch[i]==ch[i-1]) {
				count++;
				if(ch[i-1] == '0')
					ch[i] = '1';
				else
					ch[i] = '0' ;
			}
		}
		System.out.println(count);
	}
} Main public static void main(String[]args) {
		Scanner scan = new Scanner(System.in);
		char []ch = scan.next().toCharArray();
		int count = 0 ;
		for(int i = 1 ; i<ch.length ; i++) {
			if(ch[i]==ch[i-1]) {
				count++;
				if(ch[i-1] == '0')
					ch[i] = '1';
				else
					ch[i] = '0' ;
			}
		}
		System.out.println(count);
	} main {
		Scanner scan = new Scanner(System.in);
		char []ch = scan.next().toCharArray();
		int count = 0 ;
		for(int i = 1 ; i<ch.length ; i++) {
			if(ch[i]==ch[i-1]) {
				count++;
				if(ch[i-1] == '0')
					ch[i] = '1';
				else
					ch[i] = '0' ;
			}
		}
		System.out.println(count);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) char []ch = scan.next().toCharArray(); ch scan.next().toCharArray() scan.next().toCharArray scan.next() scan.next scan int count = 0 ; count 0 for(int i = 1 ; i<ch.length ; i++) {
			if(ch[i]==ch[i-1]) {
				count++;
				if(ch[i-1] == '0')
					ch[i] = '1';
				else
					ch[i] = '0' ;
			}
		} int i = 1 ; int i = 1 ; i 1 i<ch.length i ch.length ch ch.length i++ i++ i {
			if(ch[i]==ch[i-1]) {
				count++;
				if(ch[i-1] == '0')
					ch[i] = '1';
				else
					ch[i] = '0' ;
			}
		} {
			if(ch[i]==ch[i-1]) {
				count++;
				if(ch[i-1] == '0')
					ch[i] = '1';
				else
					ch[i] = '0' ;
			}
		} if(ch[i]==ch[i-1]) {
				count++;
				if(ch[i-1] == '0')
					ch[i] = '1';
				else
					ch[i] = '0' ;
			} ch[i]==ch[i-1] ch[i] ch i ch[i-1] ch i-1 i 1 {
				count++;
				if(ch[i-1] == '0')
					ch[i] = '1';
				else
					ch[i] = '0' ;
			} count++ count if(ch[i-1] == '0')
					ch[i] = '1';
				else
					ch[i] = '0' ; ch[i-1] == '0' ch[i-1] ch i-1 i 1 '0' ch[i] = '1' ch[i] ch i '1' ch[i] = '0' ch[i] ch i '0' System.out.println(count) System.out.println System.out System System.out count String[]args args

import java.util.Scanner;

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