import java.util.*;


public class Main {
    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        int count1 = 0;
        int count2 = 0;
        
        for (int i = 0; i < str.length(); i++) {
            String s = String.valueOf(str.charAt(i));
            
            if (i % 2 == 0) {
                if (s.equals("0")) {
                    count1++;
                }
            } else {
                if (s.equals("1")) {
                    count1++;
                }
            }
        }
        
        for (int i = 0; i < str.length(); i++) {
            String s = String.valueOf(str.charAt(i));
            
            if (i % 2 == 1) {
                if (s.equals("0")) {
                    count2++;
                }
            } else {
                if (s.equals("1")) {
                    count2++;
                }
            }
        }
        
        int answer = Math.min(count1, count2);
        System.out.println(answer);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        int count1 = 0;
        int count2 = 0;
        
        for (int i = 0; i < str.length(); i++) {
            String s = String.valueOf(str.charAt(i));
            
            if (i % 2 == 0) {
                if (s.equals("0")) {
                    count1++;
                }
            } else {
                if (s.equals("1")) {
                    count1++;
                }
            }
        }
        
        for (int i = 0; i < str.length(); i++) {
            String s = String.valueOf(str.charAt(i));
            
            if (i % 2 == 1) {
                if (s.equals("0")) {
                    count2++;
                }
            } else {
                if (s.equals("1")) {
                    count2++;
                }
            }
        }
        
        int answer = Math.min(count1, count2);
        System.out.println(answer);
    }
} Main public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        int count1 = 0;
        int count2 = 0;
        
        for (int i = 0; i < str.length(); i++) {
            String s = String.valueOf(str.charAt(i));
            
            if (i % 2 == 0) {
                if (s.equals("0")) {
                    count1++;
                }
            } else {
                if (s.equals("1")) {
                    count1++;
                }
            }
        }
        
        for (int i = 0; i < str.length(); i++) {
            String s = String.valueOf(str.charAt(i));
            
            if (i % 2 == 1) {
                if (s.equals("0")) {
                    count2++;
                }
            } else {
                if (s.equals("1")) {
                    count2++;
                }
            }
        }
        
        int answer = Math.min(count1, count2);
        System.out.println(answer);
    } main {

        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        int count1 = 0;
        int count2 = 0;
        
        for (int i = 0; i < str.length(); i++) {
            String s = String.valueOf(str.charAt(i));
            
            if (i % 2 == 0) {
                if (s.equals("0")) {
                    count1++;
                }
            } else {
                if (s.equals("1")) {
                    count1++;
                }
            }
        }
        
        for (int i = 0; i < str.length(); i++) {
            String s = String.valueOf(str.charAt(i));
            
            if (i % 2 == 1) {
                if (s.equals("0")) {
                    count2++;
                }
            } else {
                if (s.equals("1")) {
                    count2++;
                }
            }
        }
        
        int answer = Math.min(count1, count2);
        System.out.println(answer);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String str = sc.next(); str sc.next() sc.next sc int count1 = 0; count1 0 int count2 = 0; count2 0 for (int i = 0; i < str.length(); i++) {
            String s = String.valueOf(str.charAt(i));
            
            if (i % 2 == 0) {
                if (s.equals("0")) {
                    count1++;
                }
            } else {
                if (s.equals("1")) {
                    count1++;
                }
            }
        } int i = 0; int i = 0; i 0 i < str.length() i str.length() str.length str i++ i++ i {
            String s = String.valueOf(str.charAt(i));
            
            if (i % 2 == 0) {
                if (s.equals("0")) {
                    count1++;
                }
            } else {
                if (s.equals("1")) {
                    count1++;
                }
            }
        } {
            String s = String.valueOf(str.charAt(i));
            
            if (i % 2 == 0) {
                if (s.equals("0")) {
                    count1++;
                }
            } else {
                if (s.equals("1")) {
                    count1++;
                }
            }
        } String s = String.valueOf(str.charAt(i)); s String.valueOf(str.charAt(i)) String.valueOf String str.charAt(i) str.charAt str i if (i % 2 == 0) {
                if (s.equals("0")) {
                    count1++;
                }
            } else {
                if (s.equals("1")) {
                    count1++;
                }
            } i % 2 == 0 i % 2 i 2 0 {
                if (s.equals("0")) {
                    count1++;
                }
            } if (s.equals("0")) {
                    count1++;
                } s.equals("0") s.equals s "0" {
                    count1++;
                } count1++ count1 {
                if (s.equals("1")) {
                    count1++;
                }
            } if (s.equals("1")) {
                    count1++;
                } s.equals("1") s.equals s "1" {
                    count1++;
                } count1++ count1 for (int i = 0; i < str.length(); i++) {
            String s = String.valueOf(str.charAt(i));
            
            if (i % 2 == 1) {
                if (s.equals("0")) {
                    count2++;
                }
            } else {
                if (s.equals("1")) {
                    count2++;
                }
            }
        } int i = 0; int i = 0; i 0 i < str.length() i str.length() str.length str i++ i++ i {
            String s = String.valueOf(str.charAt(i));
            
            if (i % 2 == 1) {
                if (s.equals("0")) {
                    count2++;
                }
            } else {
                if (s.equals("1")) {
                    count2++;
                }
            }
        } {
            String s = String.valueOf(str.charAt(i));
            
            if (i % 2 == 1) {
                if (s.equals("0")) {
                    count2++;
                }
            } else {
                if (s.equals("1")) {
                    count2++;
                }
            }
        } String s = String.valueOf(str.charAt(i)); s String.valueOf(str.charAt(i)) String.valueOf String str.charAt(i) str.charAt str i if (i % 2 == 1) {
                if (s.equals("0")) {
                    count2++;
                }
            } else {
                if (s.equals("1")) {
                    count2++;
                }
            } i % 2 == 1 i % 2 i 2 1 {
                if (s.equals("0")) {
                    count2++;
                }
            } if (s.equals("0")) {
                    count2++;
                } s.equals("0") s.equals s "0" {
                    count2++;
                } count2++ count2 {
                if (s.equals("1")) {
                    count2++;
                }
            } if (s.equals("1")) {
                    count2++;
                } s.equals("1") s.equals s "1" {
                    count2++;
                } count2++ count2 int answer = Math.min(count1, count2); answer Math.min(count1, count2) Math.min Math count1 count2 System.out.println(answer) System.out.println System.out System System.out answer String[] args args public class Main {
    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        int count1 = 0;
        int count2 = 0;
        
        for (int i = 0; i < str.length(); i++) {
            String s = String.valueOf(str.charAt(i));
            
            if (i % 2 == 0) {
                if (s.equals("0")) {
                    count1++;
                }
            } else {
                if (s.equals("1")) {
                    count1++;
                }
            }
        }
        
        for (int i = 0; i < str.length(); i++) {
            String s = String.valueOf(str.charAt(i));
            
            if (i % 2 == 1) {
                if (s.equals("0")) {
                    count2++;
                }
            } else {
                if (s.equals("1")) {
                    count2++;
                }
            }
        }
        
        int answer = Math.min(count1, count2);
        System.out.println(answer);
    }
} public class Main {
    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        int count1 = 0;
        int count2 = 0;
        
        for (int i = 0; i < str.length(); i++) {
            String s = String.valueOf(str.charAt(i));
            
            if (i % 2 == 0) {
                if (s.equals("0")) {
                    count1++;
                }
            } else {
                if (s.equals("1")) {
                    count1++;
                }
            }
        }
        
        for (int i = 0; i < str.length(); i++) {
            String s = String.valueOf(str.charAt(i));
            
            if (i % 2 == 1) {
                if (s.equals("0")) {
                    count2++;
                }
            } else {
                if (s.equals("1")) {
                    count2++;
                }
            }
        }
        
        int answer = Math.min(count1, count2);
        System.out.println(answer);
    }
} Main
import java.util.*;


public class Main {
    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        int count1 = 0;
        int count2 = 0;
        
        for (int i = 0; i < str.length(); i++) {
            String s = String.valueOf(str.charAt(i));
            
            if (i % 2 == 0) {
                if (s.equals("0")) {
                    count1++;
                }
            } else {
                if (s.equals("1")) {
                    count1++;
                }
            }
        }
        
        for (int i = 0; i < str.length(); i++) {
            String s = String.valueOf(str.charAt(i));
            
            if (i % 2 == 1) {
                if (s.equals("0")) {
                    count2++;
                }
            } else {
                if (s.equals("1")) {
                    count2++;
                }
            }
        }
        
        int answer = Math.min(count1, count2);
        System.out.println(answer);
    }
}