import java.util.*;
import java.lang.*;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int result = 0;
        int kari = 0;
        for(int i = 0;i<s.length();i++){
            if(i%2==0 && s.charAt(i) == '0'){
                kari++;
            }else if(i%2==1 && s.charAt(i) == '1'){
                kari++;
            }
        }
        for(int i = 0;i<s.length();i++){
            if(i%2==0 && s.charAt(i) == '1'){
                result++;
            }else if(i%2==1 && s.charAt(i) == '0'){
                result++;
            }
        }
        if(kari<result){result = kari;}
        System.out.println(result);
        sc.close();
    }
} import java.util.*; util.* java import java.lang.*; lang.* java public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int result = 0;
        int kari = 0;
        for(int i = 0;i<s.length();i++){
            if(i%2==0 && s.charAt(i) == '0'){
                kari++;
            }else if(i%2==1 && s.charAt(i) == '1'){
                kari++;
            }
        }
        for(int i = 0;i<s.length();i++){
            if(i%2==0 && s.charAt(i) == '1'){
                result++;
            }else if(i%2==1 && s.charAt(i) == '0'){
                result++;
            }
        }
        if(kari<result){result = kari;}
        System.out.println(result);
        sc.close();
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int result = 0;
        int kari = 0;
        for(int i = 0;i<s.length();i++){
            if(i%2==0 && s.charAt(i) == '0'){
                kari++;
            }else if(i%2==1 && s.charAt(i) == '1'){
                kari++;
            }
        }
        for(int i = 0;i<s.length();i++){
            if(i%2==0 && s.charAt(i) == '1'){
                result++;
            }else if(i%2==1 && s.charAt(i) == '0'){
                result++;
            }
        }
        if(kari<result){result = kari;}
        System.out.println(result);
        sc.close();
    } main {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int result = 0;
        int kari = 0;
        for(int i = 0;i<s.length();i++){
            if(i%2==0 && s.charAt(i) == '0'){
                kari++;
            }else if(i%2==1 && s.charAt(i) == '1'){
                kari++;
            }
        }
        for(int i = 0;i<s.length();i++){
            if(i%2==0 && s.charAt(i) == '1'){
                result++;
            }else if(i%2==1 && s.charAt(i) == '0'){
                result++;
            }
        }
        if(kari<result){result = kari;}
        System.out.println(result);
        sc.close();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc int result = 0; result 0 int kari = 0; kari 0 for(int i = 0;i<s.length();i++){
            if(i%2==0 && s.charAt(i) == '0'){
                kari++;
            }else if(i%2==1 && s.charAt(i) == '1'){
                kari++;
            }
        } int i = 0; int i = 0; i 0 i<s.length() i s.length() s.length s i++ i++ i {
            if(i%2==0 && s.charAt(i) == '0'){
                kari++;
            }else if(i%2==1 && s.charAt(i) == '1'){
                kari++;
            }
        } {
            if(i%2==0 && s.charAt(i) == '0'){
                kari++;
            }else if(i%2==1 && s.charAt(i) == '1'){
                kari++;
            }
        } if(i%2==0 && s.charAt(i) == '0'){
                kari++;
            }else if(i%2==1 && s.charAt(i) == '1'){
                kari++;
            } i%2==0 && s.charAt(i) == '0' i%2==0 i%2 i 2 0 s.charAt(i) == '0' s.charAt(i) s.charAt s i '0' {
                kari++;
            } kari++ kari if(i%2==1 && s.charAt(i) == '1'){
                kari++;
            } i%2==1 && s.charAt(i) == '1' i%2==1 i%2 i 2 1 s.charAt(i) == '1' s.charAt(i) s.charAt s i '1' {
                kari++;
            } kari++ kari for(int i = 0;i<s.length();i++){
            if(i%2==0 && s.charAt(i) == '1'){
                result++;
            }else if(i%2==1 && s.charAt(i) == '0'){
                result++;
            }
        } int i = 0; int i = 0; i 0 i<s.length() i s.length() s.length s i++ i++ i {
            if(i%2==0 && s.charAt(i) == '1'){
                result++;
            }else if(i%2==1 && s.charAt(i) == '0'){
                result++;
            }
        } {
            if(i%2==0 && s.charAt(i) == '1'){
                result++;
            }else if(i%2==1 && s.charAt(i) == '0'){
                result++;
            }
        } if(i%2==0 && s.charAt(i) == '1'){
                result++;
            }else if(i%2==1 && s.charAt(i) == '0'){
                result++;
            } i%2==0 && s.charAt(i) == '1' i%2==0 i%2 i 2 0 s.charAt(i) == '1' s.charAt(i) s.charAt s i '1' {
                result++;
            } result++ result if(i%2==1 && s.charAt(i) == '0'){
                result++;
            } i%2==1 && s.charAt(i) == '0' i%2==1 i%2 i 2 1 s.charAt(i) == '0' s.charAt(i) s.charAt s i '0' {
                result++;
            } result++ result if(kari<result){result = kari;} kari<result kari result {result = kari;} result = kari result kari System.out.println(result) System.out.println System.out System System.out result sc.close() sc.close sc String[] args args public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int result = 0;
        int kari = 0;
        for(int i = 0;i<s.length();i++){
            if(i%2==0 && s.charAt(i) == '0'){
                kari++;
            }else if(i%2==1 && s.charAt(i) == '1'){
                kari++;
            }
        }
        for(int i = 0;i<s.length();i++){
            if(i%2==0 && s.charAt(i) == '1'){
                result++;
            }else if(i%2==1 && s.charAt(i) == '0'){
                result++;
            }
        }
        if(kari<result){result = kari;}
        System.out.println(result);
        sc.close();
    }
} public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int result = 0;
        int kari = 0;
        for(int i = 0;i<s.length();i++){
            if(i%2==0 && s.charAt(i) == '0'){
                kari++;
            }else if(i%2==1 && s.charAt(i) == '1'){
                kari++;
            }
        }
        for(int i = 0;i<s.length();i++){
            if(i%2==0 && s.charAt(i) == '1'){
                result++;
            }else if(i%2==1 && s.charAt(i) == '0'){
                result++;
            }
        }
        if(kari<result){result = kari;}
        System.out.println(result);
        sc.close();
    }
} Main
import java.util.*;
import java.lang.*;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int result = 0;
        int kari = 0;
        for(int i = 0;i<s.length();i++){
            if(i%2==0 && s.charAt(i) == '0'){
                kari++;
            }else if(i%2==1 && s.charAt(i) == '1'){
                kari++;
            }
        }
        for(int i = 0;i<s.length();i++){
            if(i%2==0 && s.charAt(i) == '1'){
                result++;
            }else if(i%2==1 && s.charAt(i) == '0'){
                result++;
            }
        }
        if(kari<result){result = kari;}
        System.out.println(result);
        sc.close();
    }
}