import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        
        String S = sc.next();
        
        int count = 0;
        for(int i = 0; i < S.length(); i++){
            if( S.charAt(i) - '0' == i % 2 ) count++;
        }
        
        System.out.println( Math.min(count, S.length()-count) );
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        
        String S = sc.next();
        
        int count = 0;
        for(int i = 0; i < S.length(); i++){
            if( S.charAt(i) - '0' == i % 2 ) count++;
        }
        
        System.out.println( Math.min(count, S.length()-count) );
    }
} Main public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        
        String S = sc.next();
        
        int count = 0;
        for(int i = 0; i < S.length(); i++){
            if( S.charAt(i) - '0' == i % 2 ) count++;
        }
        
        System.out.println( Math.min(count, S.length()-count) );
    } main {
        
        Scanner sc = new Scanner(System.in);
        
        String S = sc.next();
        
        int count = 0;
        for(int i = 0; i < S.length(); i++){
            if( S.charAt(i) - '0' == i % 2 ) count++;
        }
        
        System.out.println( Math.min(count, S.length()-count) );
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.next(); S sc.next() sc.next sc int count = 0; count 0 for(int i = 0; i < S.length(); i++){
            if( S.charAt(i) - '0' == i % 2 ) count++;
        } int i = 0; int i = 0; i 0 i < S.length() i S.length() S.length S i++ i++ i {
            if( S.charAt(i) - '0' == i % 2 ) count++;
        } {
            if( S.charAt(i) - '0' == i % 2 ) count++;
        } if( S.charAt(i) - '0' == i % 2 ) count++; S.charAt(i) - '0' == i % 2 S.charAt(i) - '0' S.charAt(i) S.charAt S i '0' i % 2 i 2 count++ count System.out.println( Math.min(count, S.length()-count) ) System.out.println System.out System System.out Math.min(count, S.length()-count) Math.min Math count S.length()-count S.length() S.length S count String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        
        String S = sc.next();
        
        int count = 0;
        for(int i = 0; i < S.length(); i++){
            if( S.charAt(i) - '0' == i % 2 ) count++;
        }
        
        System.out.println( Math.min(count, S.length()-count) );
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        
        String S = sc.next();
        
        int count = 0;
        for(int i = 0; i < S.length(); i++){
            if( S.charAt(i) - '0' == i % 2 ) count++;
        }
        
        System.out.println( Math.min(count, S.length()-count) );
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        
        String S = sc.next();
        
        int count = 0;
        for(int i = 0; i < S.length(); i++){
            if( S.charAt(i) - '0' == i % 2 ) count++;
        }
        
        System.out.println( Math.min(count, S.length()-count) );
    }
}
