import java.util.*;
import static java.lang.Math.*;
import java.math.BigInteger;

public class Main {
    
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		// 入力
		String s = sc.next();
		
		// 計算
		int result = 0;
		char pre = s.charAt(0);
		for(int i = 1; i < s.length(); i++){
		    char c = s.charAt(i);
		    if(pre == c){
		        result++;
		        if(c == '0'){
		            c = '1';
		        }else{
		            c = '0';
		        }
		        pre = c;
		    }else{
		        pre = c;
		    }
		}

		
		// 出力
		System.out.println(result);
        
	}
} import java.util.*; util.* java import static java.lang.Math.*; import static java.lang.Math.*; import static java.lang.Math.*; import java.math.BigInteger; BigInteger java.math public class Main {
    
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		// 入力
		String s = sc.next();
		
		// 計算
		int result = 0;
		char pre = s.charAt(0);
		for(int i = 1; i < s.length(); i++){
		    char c = s.charAt(i);
		    if(pre == c){
		        result++;
		        if(c == '0'){
		            c = '1';
		        }else{
		            c = '0';
		        }
		        pre = c;
		    }else{
		        pre = c;
		    }
		}

		
		// 出力
		System.out.println(result);
        
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		// 入力
		String s = sc.next();
		
		// 計算
		int result = 0;
		char pre = s.charAt(0);
		for(int i = 1; i < s.length(); i++){
		    char c = s.charAt(i);
		    if(pre == c){
		        result++;
		        if(c == '0'){
		            c = '1';
		        }else{
		            c = '0';
		        }
		        pre = c;
		    }else{
		        pre = c;
		    }
		}

		
		// 出力
		System.out.println(result);
        
	} main {
		Scanner sc = new Scanner(System.in);
		
		// 入力
		String s = sc.next();
		
		// 計算
		int result = 0;
		char pre = s.charAt(0);
		for(int i = 1; i < s.length(); i++){
		    char c = s.charAt(i);
		    if(pre == c){
		        result++;
		        if(c == '0'){
		            c = '1';
		        }else{
		            c = '0';
		        }
		        pre = c;
		    }else{
		        pre = c;
		    }
		}

		
		// 出力
		System.out.println(result);
        
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc int result = 0; result 0 char pre = s.charAt(0); pre s.charAt(0) s.charAt s 0 for(int i = 1; i < s.length(); i++){
		    char c = s.charAt(i);
		    if(pre == c){
		        result++;
		        if(c == '0'){
		            c = '1';
		        }else{
		            c = '0';
		        }
		        pre = c;
		    }else{
		        pre = c;
		    }
		} int i = 1; int i = 1; i 1 i < s.length() i s.length() s.length s i++ i++ i {
		    char c = s.charAt(i);
		    if(pre == c){
		        result++;
		        if(c == '0'){
		            c = '1';
		        }else{
		            c = '0';
		        }
		        pre = c;
		    }else{
		        pre = c;
		    }
		} {
		    char c = s.charAt(i);
		    if(pre == c){
		        result++;
		        if(c == '0'){
		            c = '1';
		        }else{
		            c = '0';
		        }
		        pre = c;
		    }else{
		        pre = c;
		    }
		} char c = s.charAt(i); c s.charAt(i) s.charAt s i if(pre == c){
		        result++;
		        if(c == '0'){
		            c = '1';
		        }else{
		            c = '0';
		        }
		        pre = c;
		    }else{
		        pre = c;
		    } pre == c pre c {
		        result++;
		        if(c == '0'){
		            c = '1';
		        }else{
		            c = '0';
		        }
		        pre = c;
		    } result++ result if(c == '0'){
		            c = '1';
		        }else{
		            c = '0';
		        } c == '0' c '0' {
		            c = '1';
		        } c = '1' c '1' {
		            c = '0';
		        } c = '0' c '0' pre = c pre c {
		        pre = c;
		    } pre = c pre c System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main {
    
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		// 入力
		String s = sc.next();
		
		// 計算
		int result = 0;
		char pre = s.charAt(0);
		for(int i = 1; i < s.length(); i++){
		    char c = s.charAt(i);
		    if(pre == c){
		        result++;
		        if(c == '0'){
		            c = '1';
		        }else{
		            c = '0';
		        }
		        pre = c;
		    }else{
		        pre = c;
		    }
		}

		
		// 出力
		System.out.println(result);
        
	}
} public class Main {
    
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		// 入力
		String s = sc.next();
		
		// 計算
		int result = 0;
		char pre = s.charAt(0);
		for(int i = 1; i < s.length(); i++){
		    char c = s.charAt(i);
		    if(pre == c){
		        result++;
		        if(c == '0'){
		            c = '1';
		        }else{
		            c = '0';
		        }
		        pre = c;
		    }else{
		        pre = c;
		    }
		}

		
		// 出力
		System.out.println(result);
        
	}
} Main
import java.util.*;
import static java.lang.Math.*;
import java.math.BigInteger;

public class Main {
    
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		// 入力
		String s = sc.next();
		
		// 計算
		int result = 0;
		char pre = s.charAt(0);
		for(int i = 1; i < s.length(); i++){
		    char c = s.charAt(i);
		    if(pre == c){
		        result++;
		        if(c == '0'){
		            c = '1';
		        }else{
		            c = '0';
		        }
		        pre = c;
		    }else{
		        pre = c;
		    }
		}

		
		// 出力
		System.out.println(result);
        
	}
}