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;
		int a = 0;
		int b = 0;
		for(int i = 0; i < s.length(); i++){
		    char c = s.charAt(i);
		    if(i%2 == 0){
		        if(c == '0') a++;
		        if(c == '1') b++;
		    }else{
		        if(c == '1') a++;
		        if(c == '0') b++;
		    }
		}
		result = min(a, b);
		
		// 出力
		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;
		int a = 0;
		int b = 0;
		for(int i = 0; i < s.length(); i++){
		    char c = s.charAt(i);
		    if(i%2 == 0){
		        if(c == '0') a++;
		        if(c == '1') b++;
		    }else{
		        if(c == '1') a++;
		        if(c == '0') b++;
		    }
		}
		result = min(a, b);
		
		// 出力
		System.out.println(result);
        
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		// 入力
		String s = sc.next();
		
		// 計算
		int result = 0;
		int a = 0;
		int b = 0;
		for(int i = 0; i < s.length(); i++){
		    char c = s.charAt(i);
		    if(i%2 == 0){
		        if(c == '0') a++;
		        if(c == '1') b++;
		    }else{
		        if(c == '1') a++;
		        if(c == '0') b++;
		    }
		}
		result = min(a, b);
		
		// 出力
		System.out.println(result);
        
	} main {
		Scanner sc = new Scanner(System.in);
		
		// 入力
		String s = sc.next();
		
		// 計算
		int result = 0;
		int a = 0;
		int b = 0;
		for(int i = 0; i < s.length(); i++){
		    char c = s.charAt(i);
		    if(i%2 == 0){
		        if(c == '0') a++;
		        if(c == '1') b++;
		    }else{
		        if(c == '1') a++;
		        if(c == '0') b++;
		    }
		}
		result = min(a, b);
		
		// 出力
		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 int a = 0; a 0 int b = 0; b 0 for(int i = 0; i < s.length(); i++){
		    char c = s.charAt(i);
		    if(i%2 == 0){
		        if(c == '0') a++;
		        if(c == '1') b++;
		    }else{
		        if(c == '1') a++;
		        if(c == '0') b++;
		    }
		} int i = 0; int i = 0; i 0 i < s.length() i s.length() s.length s i++ i++ i {
		    char c = s.charAt(i);
		    if(i%2 == 0){
		        if(c == '0') a++;
		        if(c == '1') b++;
		    }else{
		        if(c == '1') a++;
		        if(c == '0') b++;
		    }
		} {
		    char c = s.charAt(i);
		    if(i%2 == 0){
		        if(c == '0') a++;
		        if(c == '1') b++;
		    }else{
		        if(c == '1') a++;
		        if(c == '0') b++;
		    }
		} char c = s.charAt(i); c s.charAt(i) s.charAt s i if(i%2 == 0){
		        if(c == '0') a++;
		        if(c == '1') b++;
		    }else{
		        if(c == '1') a++;
		        if(c == '0') b++;
		    } i%2 == 0 i%2 i 2 0 {
		        if(c == '0') a++;
		        if(c == '1') b++;
		    } if(c == '0') a++; c == '0' c '0' a++ a if(c == '1') b++; c == '1' c '1' b++ b {
		        if(c == '1') a++;
		        if(c == '0') b++;
		    } if(c == '1') a++; c == '1' c '1' a++ a if(c == '0') b++; c == '0' c '0' b++ b result = min(a, b) result min(a, b) min a b 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;
		int a = 0;
		int b = 0;
		for(int i = 0; i < s.length(); i++){
		    char c = s.charAt(i);
		    if(i%2 == 0){
		        if(c == '0') a++;
		        if(c == '1') b++;
		    }else{
		        if(c == '1') a++;
		        if(c == '0') b++;
		    }
		}
		result = min(a, b);
		
		// 出力
		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;
		int a = 0;
		int b = 0;
		for(int i = 0; i < s.length(); i++){
		    char c = s.charAt(i);
		    if(i%2 == 0){
		        if(c == '0') a++;
		        if(c == '1') b++;
		    }else{
		        if(c == '1') a++;
		        if(c == '0') b++;
		    }
		}
		result = min(a, b);
		
		// 出力
		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;
		int a = 0;
		int b = 0;
		for(int i = 0; i < s.length(); i++){
		    char c = s.charAt(i);
		    if(i%2 == 0){
		        if(c == '0') a++;
		        if(c == '1') b++;
		    }else{
		        if(c == '1') a++;
		        if(c == '0') b++;
		    }
		}
		result = min(a, b);
		
		// 出力
		System.out.println(result);
        
	}
}
