import java.util.*;

public class Main{

    public static List<Integer> P;
    public static void main(String args[]){
        Scanner scanner = new Scanner(System.in);
        String S = scanner.next();
        char [] cha = S.toCharArray();

        int countFrom1 = 0;
        int countFrom0 = 0;
        for(int i=0; i<S.length(); i++){
            if(i%2==0 && cha[i]=='1'){
                countFrom0++;
            }
            if(i%2==1 && cha[i]=='0'){
                countFrom0++;
            }
            if(i%2==0 && cha[i]=='0'){
                countFrom1++;
            }
            if(i%2==1 && cha[i]=='1'){
                countFrom1++;
            }
        }
        System.out.println(Math.min(countFrom0, countFrom1));
    }
} import java.util.*; util.* java public class Main{

    public static List<Integer> P;
    public static void main(String args[]){
        Scanner scanner = new Scanner(System.in);
        String S = scanner.next();
        char [] cha = S.toCharArray();

        int countFrom1 = 0;
        int countFrom0 = 0;
        for(int i=0; i<S.length(); i++){
            if(i%2==0 && cha[i]=='1'){
                countFrom0++;
            }
            if(i%2==1 && cha[i]=='0'){
                countFrom0++;
            }
            if(i%2==0 && cha[i]=='0'){
                countFrom1++;
            }
            if(i%2==1 && cha[i]=='1'){
                countFrom1++;
            }
        }
        System.out.println(Math.min(countFrom0, countFrom1));
    }
} Main public static List<Integer> P; P public static void main(String args[]){
        Scanner scanner = new Scanner(System.in);
        String S = scanner.next();
        char [] cha = S.toCharArray();

        int countFrom1 = 0;
        int countFrom0 = 0;
        for(int i=0; i<S.length(); i++){
            if(i%2==0 && cha[i]=='1'){
                countFrom0++;
            }
            if(i%2==1 && cha[i]=='0'){
                countFrom0++;
            }
            if(i%2==0 && cha[i]=='0'){
                countFrom1++;
            }
            if(i%2==1 && cha[i]=='1'){
                countFrom1++;
            }
        }
        System.out.println(Math.min(countFrom0, countFrom1));
    } main {
        Scanner scanner = new Scanner(System.in);
        String S = scanner.next();
        char [] cha = S.toCharArray();

        int countFrom1 = 0;
        int countFrom0 = 0;
        for(int i=0; i<S.length(); i++){
            if(i%2==0 && cha[i]=='1'){
                countFrom0++;
            }
            if(i%2==1 && cha[i]=='0'){
                countFrom0++;
            }
            if(i%2==0 && cha[i]=='0'){
                countFrom1++;
            }
            if(i%2==1 && cha[i]=='1'){
                countFrom1++;
            }
        }
        System.out.println(Math.min(countFrom0, countFrom1));
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) String S = scanner.next(); S scanner.next() scanner.next scanner char [] cha = S.toCharArray(); cha S.toCharArray() S.toCharArray S int countFrom1 = 0; countFrom1 0 int countFrom0 = 0; countFrom0 0 for(int i=0; i<S.length(); i++){
            if(i%2==0 && cha[i]=='1'){
                countFrom0++;
            }
            if(i%2==1 && cha[i]=='0'){
                countFrom0++;
            }
            if(i%2==0 && cha[i]=='0'){
                countFrom1++;
            }
            if(i%2==1 && cha[i]=='1'){
                countFrom1++;
            }
        } int i=0; int i=0; i 0 i<S.length() i S.length() S.length S i++ i++ i {
            if(i%2==0 && cha[i]=='1'){
                countFrom0++;
            }
            if(i%2==1 && cha[i]=='0'){
                countFrom0++;
            }
            if(i%2==0 && cha[i]=='0'){
                countFrom1++;
            }
            if(i%2==1 && cha[i]=='1'){
                countFrom1++;
            }
        } {
            if(i%2==0 && cha[i]=='1'){
                countFrom0++;
            }
            if(i%2==1 && cha[i]=='0'){
                countFrom0++;
            }
            if(i%2==0 && cha[i]=='0'){
                countFrom1++;
            }
            if(i%2==1 && cha[i]=='1'){
                countFrom1++;
            }
        } if(i%2==0 && cha[i]=='1'){
                countFrom0++;
            } i%2==0 && cha[i]=='1' i%2==0 i%2 i 2 0 cha[i]=='1' cha[i] cha i '1' {
                countFrom0++;
            } countFrom0++ countFrom0 if(i%2==1 && cha[i]=='0'){
                countFrom0++;
            } i%2==1 && cha[i]=='0' i%2==1 i%2 i 2 1 cha[i]=='0' cha[i] cha i '0' {
                countFrom0++;
            } countFrom0++ countFrom0 if(i%2==0 && cha[i]=='0'){
                countFrom1++;
            } i%2==0 && cha[i]=='0' i%2==0 i%2 i 2 0 cha[i]=='0' cha[i] cha i '0' {
                countFrom1++;
            } countFrom1++ countFrom1 if(i%2==1 && cha[i]=='1'){
                countFrom1++;
            } i%2==1 && cha[i]=='1' i%2==1 i%2 i 2 1 cha[i]=='1' cha[i] cha i '1' {
                countFrom1++;
            } countFrom1++ countFrom1 System.out.println(Math.min(countFrom0, countFrom1)) System.out.println System.out System System.out Math.min(countFrom0, countFrom1) Math.min Math countFrom0 countFrom1 String args[] args public class Main{

    public static List<Integer> P;
    public static void main(String args[]){
        Scanner scanner = new Scanner(System.in);
        String S = scanner.next();
        char [] cha = S.toCharArray();

        int countFrom1 = 0;
        int countFrom0 = 0;
        for(int i=0; i<S.length(); i++){
            if(i%2==0 && cha[i]=='1'){
                countFrom0++;
            }
            if(i%2==1 && cha[i]=='0'){
                countFrom0++;
            }
            if(i%2==0 && cha[i]=='0'){
                countFrom1++;
            }
            if(i%2==1 && cha[i]=='1'){
                countFrom1++;
            }
        }
        System.out.println(Math.min(countFrom0, countFrom1));
    }
} public class Main{

    public static List<Integer> P;
    public static void main(String args[]){
        Scanner scanner = new Scanner(System.in);
        String S = scanner.next();
        char [] cha = S.toCharArray();

        int countFrom1 = 0;
        int countFrom0 = 0;
        for(int i=0; i<S.length(); i++){
            if(i%2==0 && cha[i]=='1'){
                countFrom0++;
            }
            if(i%2==1 && cha[i]=='0'){
                countFrom0++;
            }
            if(i%2==0 && cha[i]=='0'){
                countFrom1++;
            }
            if(i%2==1 && cha[i]=='1'){
                countFrom1++;
            }
        }
        System.out.println(Math.min(countFrom0, countFrom1));
    }
} Main
import java.util.*;

public class Main{

    public static List<Integer> P;
    public static void main(String args[]){
        Scanner scanner = new Scanner(System.in);
        String S = scanner.next();
        char [] cha = S.toCharArray();

        int countFrom1 = 0;
        int countFrom0 = 0;
        for(int i=0; i<S.length(); i++){
            if(i%2==0 && cha[i]=='1'){
                countFrom0++;
            }
            if(i%2==1 && cha[i]=='0'){
                countFrom0++;
            }
            if(i%2==0 && cha[i]=='0'){
                countFrom1++;
            }
            if(i%2==1 && cha[i]=='1'){
                countFrom1++;
            }
        }
        System.out.println(Math.min(countFrom0, countFrom1));
    }
}