import java.util.Scanner;

public class Main {
    
    public static void main(String[] args) {
        // TODO 自動生成されたメソッド・スタブ
        
        Scanner sc = new Scanner(System.in);
        String input = sc.nextLine();
        
        String[] array = input.split("");
        
        int count = 0;
        
        if ("0".equals(array[0])) {
            
            for (int i = 1; i < array.length; i++) {
                
                if (array[i].equals("0") && "0".equals(array[i - 1])) {
                    
                    array[i] = "1";
                    count++;
                }
                
                if ("1".equals(array[i]) && "1".equals(array[i - 1])) {
                    
                    array[i] = "0";
                    count++;
                }
            }
        }
        
        if (array[0].equals("1")) {
            
            for (int i = 1; i < array.length; i++) {
                
                if ("1".equals(array[i]) && "1".equals(array[i - 1])) {
                    
                    array[i] = "0";
                    count++;
                }
                
                if ("0".equals(array[i]) && "0".equals(array[i - 1])) {
                    
                    array[i] = "1";
                    count++;
                }
            }
        }
        
        System.out.println(count);
        
        sc.close();
    }
    
} import java.util.Scanner; Scanner java.util public class Main {
    
    public static void main(String[] args) {
        // TODO 自動生成されたメソッド・スタブ
        
        Scanner sc = new Scanner(System.in);
        String input = sc.nextLine();
        
        String[] array = input.split("");
        
        int count = 0;
        
        if ("0".equals(array[0])) {
            
            for (int i = 1; i < array.length; i++) {
                
                if (array[i].equals("0") && "0".equals(array[i - 1])) {
                    
                    array[i] = "1";
                    count++;
                }
                
                if ("1".equals(array[i]) && "1".equals(array[i - 1])) {
                    
                    array[i] = "0";
                    count++;
                }
            }
        }
        
        if (array[0].equals("1")) {
            
            for (int i = 1; i < array.length; i++) {
                
                if ("1".equals(array[i]) && "1".equals(array[i - 1])) {
                    
                    array[i] = "0";
                    count++;
                }
                
                if ("0".equals(array[i]) && "0".equals(array[i - 1])) {
                    
                    array[i] = "1";
                    count++;
                }
            }
        }
        
        System.out.println(count);
        
        sc.close();
    }
    
} Main public static void main(String[] args) {
        // TODO 自動生成されたメソッド・スタブ
        
        Scanner sc = new Scanner(System.in);
        String input = sc.nextLine();
        
        String[] array = input.split("");
        
        int count = 0;
        
        if ("0".equals(array[0])) {
            
            for (int i = 1; i < array.length; i++) {
                
                if (array[i].equals("0") && "0".equals(array[i - 1])) {
                    
                    array[i] = "1";
                    count++;
                }
                
                if ("1".equals(array[i]) && "1".equals(array[i - 1])) {
                    
                    array[i] = "0";
                    count++;
                }
            }
        }
        
        if (array[0].equals("1")) {
            
            for (int i = 1; i < array.length; i++) {
                
                if ("1".equals(array[i]) && "1".equals(array[i - 1])) {
                    
                    array[i] = "0";
                    count++;
                }
                
                if ("0".equals(array[i]) && "0".equals(array[i - 1])) {
                    
                    array[i] = "1";
                    count++;
                }
            }
        }
        
        System.out.println(count);
        
        sc.close();
    } main {
        // TODO 自動生成されたメソッド・スタブ
        
        Scanner sc = new Scanner(System.in);
        String input = sc.nextLine();
        
        String[] array = input.split("");
        
        int count = 0;
        
        if ("0".equals(array[0])) {
            
            for (int i = 1; i < array.length; i++) {
                
                if (array[i].equals("0") && "0".equals(array[i - 1])) {
                    
                    array[i] = "1";
                    count++;
                }
                
                if ("1".equals(array[i]) && "1".equals(array[i - 1])) {
                    
                    array[i] = "0";
                    count++;
                }
            }
        }
        
        if (array[0].equals("1")) {
            
            for (int i = 1; i < array.length; i++) {
                
                if ("1".equals(array[i]) && "1".equals(array[i - 1])) {
                    
                    array[i] = "0";
                    count++;
                }
                
                if ("0".equals(array[i]) && "0".equals(array[i - 1])) {
                    
                    array[i] = "1";
                    count++;
                }
            }
        }
        
        System.out.println(count);
        
        sc.close();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String input = sc.nextLine(); input sc.nextLine() sc.nextLine sc String[] array = input.split(""); array input.split("") input.split input "" int count = 0; count 0 if ("0".equals(array[0])) {
            
            for (int i = 1; i < array.length; i++) {
                
                if (array[i].equals("0") && "0".equals(array[i - 1])) {
                    
                    array[i] = "1";
                    count++;
                }
                
                if ("1".equals(array[i]) && "1".equals(array[i - 1])) {
                    
                    array[i] = "0";
                    count++;
                }
            }
        } "0".equals(array[0]) "0".equals "0" array[0] array 0 {
            
            for (int i = 1; i < array.length; i++) {
                
                if (array[i].equals("0") && "0".equals(array[i - 1])) {
                    
                    array[i] = "1";
                    count++;
                }
                
                if ("1".equals(array[i]) && "1".equals(array[i - 1])) {
                    
                    array[i] = "0";
                    count++;
                }
            }
        } for (int i = 1; i < array.length; i++) {
                
                if (array[i].equals("0") && "0".equals(array[i - 1])) {
                    
                    array[i] = "1";
                    count++;
                }
                
                if ("1".equals(array[i]) && "1".equals(array[i - 1])) {
                    
                    array[i] = "0";
                    count++;
                }
            } int i = 1; int i = 1; i 1 i < array.length i array.length array array.length i++ i++ i {
                
                if (array[i].equals("0") && "0".equals(array[i - 1])) {
                    
                    array[i] = "1";
                    count++;
                }
                
                if ("1".equals(array[i]) && "1".equals(array[i - 1])) {
                    
                    array[i] = "0";
                    count++;
                }
            } {
                
                if (array[i].equals("0") && "0".equals(array[i - 1])) {
                    
                    array[i] = "1";
                    count++;
                }
                
                if ("1".equals(array[i]) && "1".equals(array[i - 1])) {
                    
                    array[i] = "0";
                    count++;
                }
            } if (array[i].equals("0") && "0".equals(array[i - 1])) {
                    
                    array[i] = "1";
                    count++;
                } array[i].equals("0") && "0".equals(array[i - 1]) array[i].equals("0") array[i].equals array[i] array i "0" "0".equals(array[i - 1]) "0".equals "0" array[i - 1] array i - 1 i 1 {
                    
                    array[i] = "1";
                    count++;
                } array[i] = "1" array[i] array i "1" count++ count if ("1".equals(array[i]) && "1".equals(array[i - 1])) {
                    
                    array[i] = "0";
                    count++;
                } "1".equals(array[i]) && "1".equals(array[i - 1]) "1".equals(array[i]) "1".equals "1" array[i] array i "1".equals(array[i - 1]) "1".equals "1" array[i - 1] array i - 1 i 1 {
                    
                    array[i] = "0";
                    count++;
                } array[i] = "0" array[i] array i "0" count++ count if (array[0].equals("1")) {
            
            for (int i = 1; i < array.length; i++) {
                
                if ("1".equals(array[i]) && "1".equals(array[i - 1])) {
                    
                    array[i] = "0";
                    count++;
                }
                
                if ("0".equals(array[i]) && "0".equals(array[i - 1])) {
                    
                    array[i] = "1";
                    count++;
                }
            }
        } array[0].equals("1") array[0].equals array[0] array 0 "1" {
            
            for (int i = 1; i < array.length; i++) {
                
                if ("1".equals(array[i]) && "1".equals(array[i - 1])) {
                    
                    array[i] = "0";
                    count++;
                }
                
                if ("0".equals(array[i]) && "0".equals(array[i - 1])) {
                    
                    array[i] = "1";
                    count++;
                }
            }
        } for (int i = 1; i < array.length; i++) {
                
                if ("1".equals(array[i]) && "1".equals(array[i - 1])) {
                    
                    array[i] = "0";
                    count++;
                }
                
                if ("0".equals(array[i]) && "0".equals(array[i - 1])) {
                    
                    array[i] = "1";
                    count++;
                }
            } int i = 1; int i = 1; i 1 i < array.length i array.length array array.length i++ i++ i {
                
                if ("1".equals(array[i]) && "1".equals(array[i - 1])) {
                    
                    array[i] = "0";
                    count++;
                }
                
                if ("0".equals(array[i]) && "0".equals(array[i - 1])) {
                    
                    array[i] = "1";
                    count++;
                }
            } {
                
                if ("1".equals(array[i]) && "1".equals(array[i - 1])) {
                    
                    array[i] = "0";
                    count++;
                }
                
                if ("0".equals(array[i]) && "0".equals(array[i - 1])) {
                    
                    array[i] = "1";
                    count++;
                }
            } if ("1".equals(array[i]) && "1".equals(array[i - 1])) {
                    
                    array[i] = "0";
                    count++;
                } "1".equals(array[i]) && "1".equals(array[i - 1]) "1".equals(array[i]) "1".equals "1" array[i] array i "1".equals(array[i - 1]) "1".equals "1" array[i - 1] array i - 1 i 1 {
                    
                    array[i] = "0";
                    count++;
                } array[i] = "0" array[i] array i "0" count++ count if ("0".equals(array[i]) && "0".equals(array[i - 1])) {
                    
                    array[i] = "1";
                    count++;
                } "0".equals(array[i]) && "0".equals(array[i - 1]) "0".equals(array[i]) "0".equals "0" array[i] array i "0".equals(array[i - 1]) "0".equals "0" array[i - 1] array i - 1 i 1 {
                    
                    array[i] = "1";
                    count++;
                } array[i] = "1" array[i] array i "1" count++ count System.out.println(count) System.out.println System.out System System.out count sc.close() sc.close sc String[] args args public class Main {
    
    public static void main(String[] args) {
        // TODO 自動生成されたメソッド・スタブ
        
        Scanner sc = new Scanner(System.in);
        String input = sc.nextLine();
        
        String[] array = input.split("");
        
        int count = 0;
        
        if ("0".equals(array[0])) {
            
            for (int i = 1; i < array.length; i++) {
                
                if (array[i].equals("0") && "0".equals(array[i - 1])) {
                    
                    array[i] = "1";
                    count++;
                }
                
                if ("1".equals(array[i]) && "1".equals(array[i - 1])) {
                    
                    array[i] = "0";
                    count++;
                }
            }
        }
        
        if (array[0].equals("1")) {
            
            for (int i = 1; i < array.length; i++) {
                
                if ("1".equals(array[i]) && "1".equals(array[i - 1])) {
                    
                    array[i] = "0";
                    count++;
                }
                
                if ("0".equals(array[i]) && "0".equals(array[i - 1])) {
                    
                    array[i] = "1";
                    count++;
                }
            }
        }
        
        System.out.println(count);
        
        sc.close();
    }
    
} public class Main {
    
    public static void main(String[] args) {
        // TODO 自動生成されたメソッド・スタブ
        
        Scanner sc = new Scanner(System.in);
        String input = sc.nextLine();
        
        String[] array = input.split("");
        
        int count = 0;
        
        if ("0".equals(array[0])) {
            
            for (int i = 1; i < array.length; i++) {
                
                if (array[i].equals("0") && "0".equals(array[i - 1])) {
                    
                    array[i] = "1";
                    count++;
                }
                
                if ("1".equals(array[i]) && "1".equals(array[i - 1])) {
                    
                    array[i] = "0";
                    count++;
                }
            }
        }
        
        if (array[0].equals("1")) {
            
            for (int i = 1; i < array.length; i++) {
                
                if ("1".equals(array[i]) && "1".equals(array[i - 1])) {
                    
                    array[i] = "0";
                    count++;
                }
                
                if ("0".equals(array[i]) && "0".equals(array[i - 1])) {
                    
                    array[i] = "1";
                    count++;
                }
            }
        }
        
        System.out.println(count);
        
        sc.close();
    }
    
} Main
import java.util.Scanner;

public class Main {
    
    public static void main(String[] args) {
        // TODO 自動生成されたメソッド・スタブ
        
        Scanner sc = new Scanner(System.in);
        String input = sc.nextLine();
        
        String[] array = input.split("");
        
        int count = 0;
        
        if ("0".equals(array[0])) {
            
            for (int i = 1; i < array.length; i++) {
                
                if (array[i].equals("0") && "0".equals(array[i - 1])) {
                    
                    array[i] = "1";
                    count++;
                }
                
                if ("1".equals(array[i]) && "1".equals(array[i - 1])) {
                    
                    array[i] = "0";
                    count++;
                }
            }
        }
        
        if (array[0].equals("1")) {
            
            for (int i = 1; i < array.length; i++) {
                
                if ("1".equals(array[i]) && "1".equals(array[i - 1])) {
                    
                    array[i] = "0";
                    count++;
                }
                
                if ("0".equals(array[i]) && "0".equals(array[i - 1])) {
                    
                    array[i] = "1";
                    count++;
                }
            }
        }
        
        System.out.println(count);
        
        sc.close();
    }
    
}
