import java.io.*;
public class Main{
    public static void main(String[] args) throws IOException{
        BufferedReader bf = 
            new BufferedReader(new InputStreamReader(System.in));
        String color = bf.readLine();
        int num1 = 0,
            num2 = 0;
        for(int i = 0; i < color.length(); i++){
            if(i%2 ==  Character.getNumericValue(color.charAt(i))){
                num1++;
            }
            else{
                num2++;
            }
        }
        System.out.println(Math.min(num1, num2));
    }
} import java.io.*; io.* java public class Main{
    public static void main(String[] args) throws IOException{
        BufferedReader bf = 
            new BufferedReader(new InputStreamReader(System.in));
        String color = bf.readLine();
        int num1 = 0,
            num2 = 0;
        for(int i = 0; i < color.length(); i++){
            if(i%2 ==  Character.getNumericValue(color.charAt(i))){
                num1++;
            }
            else{
                num2++;
            }
        }
        System.out.println(Math.min(num1, num2));
    }
} Main public static void main(String[] args) throws IOException{
        BufferedReader bf = 
            new BufferedReader(new InputStreamReader(System.in));
        String color = bf.readLine();
        int num1 = 0,
            num2 = 0;
        for(int i = 0; i < color.length(); i++){
            if(i%2 ==  Character.getNumericValue(color.charAt(i))){
                num1++;
            }
            else{
                num2++;
            }
        }
        System.out.println(Math.min(num1, num2));
    } main {
        BufferedReader bf = 
            new BufferedReader(new InputStreamReader(System.in));
        String color = bf.readLine();
        int num1 = 0,
            num2 = 0;
        for(int i = 0; i < color.length(); i++){
            if(i%2 ==  Character.getNumericValue(color.charAt(i))){
                num1++;
            }
            else{
                num2++;
            }
        }
        System.out.println(Math.min(num1, num2));
    } BufferedReader bf = 
            new BufferedReader(new InputStreamReader(System.in)); bf new BufferedReader(new InputStreamReader(System.in)) String color = bf.readLine(); color bf.readLine() bf.readLine bf int num1 = 0 num1 0 num2 = 0; num2 0 for(int i = 0; i < color.length(); i++){
            if(i%2 ==  Character.getNumericValue(color.charAt(i))){
                num1++;
            }
            else{
                num2++;
            }
        } int i = 0; int i = 0; i 0 i < color.length() i color.length() color.length color i++ i++ i {
            if(i%2 ==  Character.getNumericValue(color.charAt(i))){
                num1++;
            }
            else{
                num2++;
            }
        } {
            if(i%2 ==  Character.getNumericValue(color.charAt(i))){
                num1++;
            }
            else{
                num2++;
            }
        } if(i%2 ==  Character.getNumericValue(color.charAt(i))){
                num1++;
            }
            else{
                num2++;
            } i%2 ==  Character.getNumericValue(color.charAt(i)) i%2 i 2 Character.getNumericValue(color.charAt(i)) Character.getNumericValue Character color.charAt(i) color.charAt color i {
                num1++;
            } num1++ num1 {
                num2++;
            } num2++ num2 System.out.println(Math.min(num1, num2)) System.out.println System.out System System.out Math.min(num1, num2) Math.min Math num1 num2 String[] args args public class Main{
    public static void main(String[] args) throws IOException{
        BufferedReader bf = 
            new BufferedReader(new InputStreamReader(System.in));
        String color = bf.readLine();
        int num1 = 0,
            num2 = 0;
        for(int i = 0; i < color.length(); i++){
            if(i%2 ==  Character.getNumericValue(color.charAt(i))){
                num1++;
            }
            else{
                num2++;
            }
        }
        System.out.println(Math.min(num1, num2));
    }
} public class Main{
    public static void main(String[] args) throws IOException{
        BufferedReader bf = 
            new BufferedReader(new InputStreamReader(System.in));
        String color = bf.readLine();
        int num1 = 0,
            num2 = 0;
        for(int i = 0; i < color.length(); i++){
            if(i%2 ==  Character.getNumericValue(color.charAt(i))){
                num1++;
            }
            else{
                num2++;
            }
        }
        System.out.println(Math.min(num1, num2));
    }
} Main
import java.io.*;
public class Main{
    public static void main(String[] args) throws IOException{
        BufferedReader bf = 
            new BufferedReader(new InputStreamReader(System.in));
        String color = bf.readLine();
        int num1 = 0,
            num2 = 0;
        for(int i = 0; i < color.length(); i++){
            if(i%2 ==  Character.getNumericValue(color.charAt(i))){
                num1++;
            }
            else{
                num2++;
            }
        }
        System.out.println(Math.min(num1, num2));
    }
}