import java.util.Scanner;

public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char[] s = sc.next().toCharArray();
        sc.close();
        int n = s.length;
        int cnt = 0;
        int res;
        //白黒
        for(int i=0;i<n;i++){
            if(i%2==0 && s[i] !='1'){
                cnt++;
            }else if(i%2 != 0 && s[i]!='0'){
                cnt++;
            }
        }
        //黒白
        res = cnt;
        cnt = 0;
        for(int i=0;i<n;i++){
            if(i%2==0 && s[i] !='0'){
                cnt++;
            }else if(i%2 != 0 && s[i]!='1'){
                cnt++;
            }
        }
        System.out.println(Math.min(res,cnt));
    }
} import java.util.Scanner; Scanner java.util public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char[] s = sc.next().toCharArray();
        sc.close();
        int n = s.length;
        int cnt = 0;
        int res;
        //白黒
        for(int i=0;i<n;i++){
            if(i%2==0 && s[i] !='1'){
                cnt++;
            }else if(i%2 != 0 && s[i]!='0'){
                cnt++;
            }
        }
        //黒白
        res = cnt;
        cnt = 0;
        for(int i=0;i<n;i++){
            if(i%2==0 && s[i] !='0'){
                cnt++;
            }else if(i%2 != 0 && s[i]!='1'){
                cnt++;
            }
        }
        System.out.println(Math.min(res,cnt));
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char[] s = sc.next().toCharArray();
        sc.close();
        int n = s.length;
        int cnt = 0;
        int res;
        //白黒
        for(int i=0;i<n;i++){
            if(i%2==0 && s[i] !='1'){
                cnt++;
            }else if(i%2 != 0 && s[i]!='0'){
                cnt++;
            }
        }
        //黒白
        res = cnt;
        cnt = 0;
        for(int i=0;i<n;i++){
            if(i%2==0 && s[i] !='0'){
                cnt++;
            }else if(i%2 != 0 && s[i]!='1'){
                cnt++;
            }
        }
        System.out.println(Math.min(res,cnt));
    } main {
        Scanner sc = new Scanner(System.in);
        char[] s = sc.next().toCharArray();
        sc.close();
        int n = s.length;
        int cnt = 0;
        int res;
        //白黒
        for(int i=0;i<n;i++){
            if(i%2==0 && s[i] !='1'){
                cnt++;
            }else if(i%2 != 0 && s[i]!='0'){
                cnt++;
            }
        }
        //黒白
        res = cnt;
        cnt = 0;
        for(int i=0;i<n;i++){
            if(i%2==0 && s[i] !='0'){
                cnt++;
            }else if(i%2 != 0 && s[i]!='1'){
                cnt++;
            }
        }
        System.out.println(Math.min(res,cnt));
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) char[] s = sc.next().toCharArray(); s sc.next().toCharArray() sc.next().toCharArray sc.next() sc.next sc sc.close() sc.close sc int n = s.length; n s.length s s.length int cnt = 0; cnt 0 int res; res for(int i=0;i<n;i++){
            if(i%2==0 && s[i] !='1'){
                cnt++;
            }else if(i%2 != 0 && s[i]!='0'){
                cnt++;
            }
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
            if(i%2==0 && s[i] !='1'){
                cnt++;
            }else if(i%2 != 0 && s[i]!='0'){
                cnt++;
            }
        } {
            if(i%2==0 && s[i] !='1'){
                cnt++;
            }else if(i%2 != 0 && s[i]!='0'){
                cnt++;
            }
        } if(i%2==0 && s[i] !='1'){
                cnt++;
            }else if(i%2 != 0 && s[i]!='0'){
                cnt++;
            } i%2==0 && s[i] !='1' i%2==0 i%2 i 2 0 s[i] !='1' s[i] s i '1' {
                cnt++;
            } cnt++ cnt if(i%2 != 0 && s[i]!='0'){
                cnt++;
            } i%2 != 0 && s[i]!='0' i%2 != 0 i%2 i 2 0 s[i]!='0' s[i] s i '0' {
                cnt++;
            } cnt++ cnt res = cnt res cnt cnt = 0 cnt 0 for(int i=0;i<n;i++){
            if(i%2==0 && s[i] !='0'){
                cnt++;
            }else if(i%2 != 0 && s[i]!='1'){
                cnt++;
            }
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
            if(i%2==0 && s[i] !='0'){
                cnt++;
            }else if(i%2 != 0 && s[i]!='1'){
                cnt++;
            }
        } {
            if(i%2==0 && s[i] !='0'){
                cnt++;
            }else if(i%2 != 0 && s[i]!='1'){
                cnt++;
            }
        } if(i%2==0 && s[i] !='0'){
                cnt++;
            }else if(i%2 != 0 && s[i]!='1'){
                cnt++;
            } i%2==0 && s[i] !='0' i%2==0 i%2 i 2 0 s[i] !='0' s[i] s i '0' {
                cnt++;
            } cnt++ cnt if(i%2 != 0 && s[i]!='1'){
                cnt++;
            } i%2 != 0 && s[i]!='1' i%2 != 0 i%2 i 2 0 s[i]!='1' s[i] s i '1' {
                cnt++;
            } cnt++ cnt System.out.println(Math.min(res,cnt)) System.out.println System.out System System.out Math.min(res,cnt) Math.min Math res cnt String[] args args public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char[] s = sc.next().toCharArray();
        sc.close();
        int n = s.length;
        int cnt = 0;
        int res;
        //白黒
        for(int i=0;i<n;i++){
            if(i%2==0 && s[i] !='1'){
                cnt++;
            }else if(i%2 != 0 && s[i]!='0'){
                cnt++;
            }
        }
        //黒白
        res = cnt;
        cnt = 0;
        for(int i=0;i<n;i++){
            if(i%2==0 && s[i] !='0'){
                cnt++;
            }else if(i%2 != 0 && s[i]!='1'){
                cnt++;
            }
        }
        System.out.println(Math.min(res,cnt));
    }
} public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char[] s = sc.next().toCharArray();
        sc.close();
        int n = s.length;
        int cnt = 0;
        int res;
        //白黒
        for(int i=0;i<n;i++){
            if(i%2==0 && s[i] !='1'){
                cnt++;
            }else if(i%2 != 0 && s[i]!='0'){
                cnt++;
            }
        }
        //黒白
        res = cnt;
        cnt = 0;
        for(int i=0;i<n;i++){
            if(i%2==0 && s[i] !='0'){
                cnt++;
            }else if(i%2 != 0 && s[i]!='1'){
                cnt++;
            }
        }
        System.out.println(Math.min(res,cnt));
    }
} Main
import java.util.Scanner;

public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char[] s = sc.next().toCharArray();
        sc.close();
        int n = s.length;
        int cnt = 0;
        int res;
        //白黒
        for(int i=0;i<n;i++){
            if(i%2==0 && s[i] !='1'){
                cnt++;
            }else if(i%2 != 0 && s[i]!='0'){
                cnt++;
            }
        }
        //黒白
        res = cnt;
        cnt = 0;
        for(int i=0;i<n;i++){
            if(i%2==0 && s[i] !='0'){
                cnt++;
            }else if(i%2 != 0 && s[i]!='1'){
                cnt++;
            }
        }
        System.out.println(Math.min(res,cnt));
    }
}