import java.util.*;
class Main{
    public static void main(String[] args) {
        //入力
        Scanner scn=new Scanner(System.in);
        String tile=scn.next();
        //処理
        int[] cnt=new int[2];
        for(int i=0;i<2;i++){
            cnt[i]=0;
            for(int j=0;j<tile.length();j++){
                if(j%2==0&&Character.getNumericValue(tile.charAt(j))==i) cnt[i]++;
                
                if(j%2==1&Character.getNumericValue(tile.charAt(j))!=i) cnt[i]++;
                
            }
        }
       //出力
        System.out.println(Math.min(cnt[0],cnt[1]));
    }
} import java.util.*; util.* java class Main{
    public static void main(String[] args) {
        //入力
        Scanner scn=new Scanner(System.in);
        String tile=scn.next();
        //処理
        int[] cnt=new int[2];
        for(int i=0;i<2;i++){
            cnt[i]=0;
            for(int j=0;j<tile.length();j++){
                if(j%2==0&&Character.getNumericValue(tile.charAt(j))==i) cnt[i]++;
                
                if(j%2==1&Character.getNumericValue(tile.charAt(j))!=i) cnt[i]++;
                
            }
        }
       //出力
        System.out.println(Math.min(cnt[0],cnt[1]));
    }
} Main public static void main(String[] args) {
        //入力
        Scanner scn=new Scanner(System.in);
        String tile=scn.next();
        //処理
        int[] cnt=new int[2];
        for(int i=0;i<2;i++){
            cnt[i]=0;
            for(int j=0;j<tile.length();j++){
                if(j%2==0&&Character.getNumericValue(tile.charAt(j))==i) cnt[i]++;
                
                if(j%2==1&Character.getNumericValue(tile.charAt(j))!=i) cnt[i]++;
                
            }
        }
       //出力
        System.out.println(Math.min(cnt[0],cnt[1]));
    } main {
        //入力
        Scanner scn=new Scanner(System.in);
        String tile=scn.next();
        //処理
        int[] cnt=new int[2];
        for(int i=0;i<2;i++){
            cnt[i]=0;
            for(int j=0;j<tile.length();j++){
                if(j%2==0&&Character.getNumericValue(tile.charAt(j))==i) cnt[i]++;
                
                if(j%2==1&Character.getNumericValue(tile.charAt(j))!=i) cnt[i]++;
                
            }
        }
       //出力
        System.out.println(Math.min(cnt[0],cnt[1]));
    } Scanner scn=new Scanner(System.in); scn new Scanner(System.in) String tile=scn.next(); tile scn.next() scn.next scn int[] cnt=new int[2]; cnt new int[2] 2 for(int i=0;i<2;i++){
            cnt[i]=0;
            for(int j=0;j<tile.length();j++){
                if(j%2==0&&Character.getNumericValue(tile.charAt(j))==i) cnt[i]++;
                
                if(j%2==1&Character.getNumericValue(tile.charAt(j))!=i) cnt[i]++;
                
            }
        } int i=0; int i=0; i 0 i<2 i 2 i++ i++ i {
            cnt[i]=0;
            for(int j=0;j<tile.length();j++){
                if(j%2==0&&Character.getNumericValue(tile.charAt(j))==i) cnt[i]++;
                
                if(j%2==1&Character.getNumericValue(tile.charAt(j))!=i) cnt[i]++;
                
            }
        } {
            cnt[i]=0;
            for(int j=0;j<tile.length();j++){
                if(j%2==0&&Character.getNumericValue(tile.charAt(j))==i) cnt[i]++;
                
                if(j%2==1&Character.getNumericValue(tile.charAt(j))!=i) cnt[i]++;
                
            }
        } cnt[i]=0 cnt[i] cnt i 0 for(int j=0;j<tile.length();j++){
                if(j%2==0&&Character.getNumericValue(tile.charAt(j))==i) cnt[i]++;
                
                if(j%2==1&Character.getNumericValue(tile.charAt(j))!=i) cnt[i]++;
                
            } int j=0; int j=0; j 0 j<tile.length() j tile.length() tile.length tile j++ j++ j {
                if(j%2==0&&Character.getNumericValue(tile.charAt(j))==i) cnt[i]++;
                
                if(j%2==1&Character.getNumericValue(tile.charAt(j))!=i) cnt[i]++;
                
            } {
                if(j%2==0&&Character.getNumericValue(tile.charAt(j))==i) cnt[i]++;
                
                if(j%2==1&Character.getNumericValue(tile.charAt(j))!=i) cnt[i]++;
                
            } if(j%2==0&&Character.getNumericValue(tile.charAt(j))==i) cnt[i]++; j%2==0&&Character.getNumericValue(tile.charAt(j))==i j%2==0 j%2 j 2 0 Character.getNumericValue(tile.charAt(j))==i Character.getNumericValue(tile.charAt(j)) Character.getNumericValue Character tile.charAt(j) tile.charAt tile j i cnt[i]++ cnt[i] cnt i if(j%2==1&Character.getNumericValue(tile.charAt(j))!=i) cnt[i]++; j%2==1&Character.getNumericValue(tile.charAt(j))!=i j%2==1 j%2 j 2 1 Character.getNumericValue(tile.charAt(j))!=i Character.getNumericValue(tile.charAt(j)) Character.getNumericValue Character tile.charAt(j) tile.charAt tile j i cnt[i]++ cnt[i] cnt i System.out.println(Math.min(cnt[0],cnt[1])) System.out.println System.out System System.out Math.min(cnt[0],cnt[1]) Math.min Math cnt[0] cnt 0 cnt[1] cnt 1 String[] args args
import java.util.*;
class Main{
    public static void main(String[] args) {
        //入力
        Scanner scn=new Scanner(System.in);
        String tile=scn.next();
        //処理
        int[] cnt=new int[2];
        for(int i=0;i<2;i++){
            cnt[i]=0;
            for(int j=0;j<tile.length();j++){
                if(j%2==0&&Character.getNumericValue(tile.charAt(j))==i) cnt[i]++;
                
                if(j%2==1&Character.getNumericValue(tile.charAt(j))!=i) cnt[i]++;
                
            }
        }
       //出力
        System.out.println(Math.min(cnt[0],cnt[1]));
    }
}
