
import java.util.Scanner;

public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        
        Scanner s = new Scanner(System.in);
        String str = s.next();
        
        char[] cs = str.toCharArray();
        int changes = 0;
        
        for (int i = 1; i < str.length(); i ++) {
            if (cs[i] == cs[i - 1]) {
                changes ++;
                if (cs[i] == '0')
                    cs[i] = '1';
                else
                    cs[i] = '0';
            }
                
        }
        
        
        System.out.println(changes);
        
    }
    
} import java.util.Scanner; Scanner java.util public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        
        Scanner s = new Scanner(System.in);
        String str = s.next();
        
        char[] cs = str.toCharArray();
        int changes = 0;
        
        for (int i = 1; i < str.length(); i ++) {
            if (cs[i] == cs[i - 1]) {
                changes ++;
                if (cs[i] == '0')
                    cs[i] = '1';
                else
                    cs[i] = '0';
            }
                
        }
        
        
        System.out.println(changes);
        
    }
    
} Main /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        
        Scanner s = new Scanner(System.in);
        String str = s.next();
        
        char[] cs = str.toCharArray();
        int changes = 0;
        
        for (int i = 1; i < str.length(); i ++) {
            if (cs[i] == cs[i - 1]) {
                changes ++;
                if (cs[i] == '0')
                    cs[i] = '1';
                else
                    cs[i] = '0';
            }
                
        }
        
        
        System.out.println(changes);
        
    } main {
        
        Scanner s = new Scanner(System.in);
        String str = s.next();
        
        char[] cs = str.toCharArray();
        int changes = 0;
        
        for (int i = 1; i < str.length(); i ++) {
            if (cs[i] == cs[i - 1]) {
                changes ++;
                if (cs[i] == '0')
                    cs[i] = '1';
                else
                    cs[i] = '0';
            }
                
        }
        
        
        System.out.println(changes);
        
    } Scanner s = new Scanner(System.in); s new Scanner(System.in) String str = s.next(); str s.next() s.next s char[] cs = str.toCharArray(); cs str.toCharArray() str.toCharArray str int changes = 0; changes 0 for (int i = 1; i < str.length(); i ++) {
            if (cs[i] == cs[i - 1]) {
                changes ++;
                if (cs[i] == '0')
                    cs[i] = '1';
                else
                    cs[i] = '0';
            }
                
        } int i = 1; int i = 1; i 1 i < str.length() i str.length() str.length str i ++ i ++ i {
            if (cs[i] == cs[i - 1]) {
                changes ++;
                if (cs[i] == '0')
                    cs[i] = '1';
                else
                    cs[i] = '0';
            }
                
        } {
            if (cs[i] == cs[i - 1]) {
                changes ++;
                if (cs[i] == '0')
                    cs[i] = '1';
                else
                    cs[i] = '0';
            }
                
        } if (cs[i] == cs[i - 1]) {
                changes ++;
                if (cs[i] == '0')
                    cs[i] = '1';
                else
                    cs[i] = '0';
            } cs[i] == cs[i - 1] cs[i] cs i cs[i - 1] cs i - 1 i 1 {
                changes ++;
                if (cs[i] == '0')
                    cs[i] = '1';
                else
                    cs[i] = '0';
            } changes ++ changes if (cs[i] == '0')
                    cs[i] = '1';
                else
                    cs[i] = '0'; cs[i] == '0' cs[i] cs i '0' cs[i] = '1' cs[i] cs i '1' cs[i] = '0' cs[i] cs i '0' System.out.println(changes) System.out.println System.out System System.out changes String[] args args public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        
        Scanner s = new Scanner(System.in);
        String str = s.next();
        
        char[] cs = str.toCharArray();
        int changes = 0;
        
        for (int i = 1; i < str.length(); i ++) {
            if (cs[i] == cs[i - 1]) {
                changes ++;
                if (cs[i] == '0')
                    cs[i] = '1';
                else
                    cs[i] = '0';
            }
                
        }
        
        
        System.out.println(changes);
        
    }
    
} public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        
        Scanner s = new Scanner(System.in);
        String str = s.next();
        
        char[] cs = str.toCharArray();
        int changes = 0;
        
        for (int i = 1; i < str.length(); i ++) {
            if (cs[i] == cs[i - 1]) {
                changes ++;
                if (cs[i] == '0')
                    cs[i] = '1';
                else
                    cs[i] = '0';
            }
                
        }
        
        
        System.out.println(changes);
        
    }
    
} Main

import java.util.Scanner;

public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        
        Scanner s = new Scanner(System.in);
        String str = s.next();
        
        char[] cs = str.toCharArray();
        int changes = 0;
        
        for (int i = 1; i < str.length(); i ++) {
            if (cs[i] == cs[i - 1]) {
                changes ++;
                if (cs[i] == '0')
                    cs[i] = '1';
                else
                    cs[i] = '0';
            }
                
        }
        
        
        System.out.println(changes);
        
    }
    
}
