import java.util.Arrays;
import java.util.Scanner;

public class Main {

    static int find(int curr, String s){
        int cans = 0;
        for(int i = 0; i < s.length(); i++){
            int to = s.charAt(i) - '0';
            if(to != curr) cans++;
            curr ^= 1;
        }
        return cans;
    }

    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int ans = Math.min(find(0, s), find(1, s));
        System.out.print(ans);
    }
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {

    static int find(int curr, String s){
        int cans = 0;
        for(int i = 0; i < s.length(); i++){
            int to = s.charAt(i) - '0';
            if(to != curr) cans++;
            curr ^= 1;
        }
        return cans;
    }

    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int ans = Math.min(find(0, s), find(1, s));
        System.out.print(ans);
    }
} Main static int find(int curr, String s){
        int cans = 0;
        for(int i = 0; i < s.length(); i++){
            int to = s.charAt(i) - '0';
            if(to != curr) cans++;
            curr ^= 1;
        }
        return cans;
    } find {
        int cans = 0;
        for(int i = 0; i < s.length(); i++){
            int to = s.charAt(i) - '0';
            if(to != curr) cans++;
            curr ^= 1;
        }
        return cans;
    } int cans = 0; cans 0 for(int i = 0; i < s.length(); i++){
            int to = s.charAt(i) - '0';
            if(to != curr) cans++;
            curr ^= 1;
        } int i = 0; int i = 0; i 0 i < s.length() i s.length() s.length s i++ i++ i {
            int to = s.charAt(i) - '0';
            if(to != curr) cans++;
            curr ^= 1;
        } {
            int to = s.charAt(i) - '0';
            if(to != curr) cans++;
            curr ^= 1;
        } int to = s.charAt(i) - '0'; to s.charAt(i) - '0' s.charAt(i) s.charAt s i '0' if(to != curr) cans++; to != curr to curr cans++ cans curr ^= 1 curr 1 return cans; cans int curr curr String s s public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int ans = Math.min(find(0, s), find(1, s));
        System.out.print(ans);
    } main {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int ans = Math.min(find(0, s), find(1, s));
        System.out.print(ans);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc int ans = Math.min(find(0, s), find(1, s)); ans Math.min(find(0, s), find(1, s)) Math.min Math find(0, s) find 0 s find(1, s) find 1 s System.out.print(ans) System.out.print System.out System System.out ans String args[] args public class Main {

    static int find(int curr, String s){
        int cans = 0;
        for(int i = 0; i < s.length(); i++){
            int to = s.charAt(i) - '0';
            if(to != curr) cans++;
            curr ^= 1;
        }
        return cans;
    }

    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int ans = Math.min(find(0, s), find(1, s));
        System.out.print(ans);
    }
} public class Main {

    static int find(int curr, String s){
        int cans = 0;
        for(int i = 0; i < s.length(); i++){
            int to = s.charAt(i) - '0';
            if(to != curr) cans++;
            curr ^= 1;
        }
        return cans;
    }

    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int ans = Math.min(find(0, s), find(1, s));
        System.out.print(ans);
    }
} Main
import java.util.Arrays;
import java.util.Scanner;

public class Main {

    static int find(int curr, String s){
        int cans = 0;
        for(int i = 0; i < s.length(); i++){
            int to = s.charAt(i) - '0';
            if(to != curr) cans++;
            curr ^= 1;
        }
        return cans;
    }

    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int ans = Math.min(find(0, s), find(1, s));
        System.out.print(ans);
    }
}
