import java.util.Scanner;

public class Main{
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        String tile = sc.nextLine();
        sc.close();

        int tile_length = tile.length();
        int plan1_pieces = 0;
        int plan2_pieces = 0;

        for(int i = 0; i < tile_length; i++){
            char curTile = tile.charAt(i);
            if(i % 2 == 0){
                if(curTile == '1') plan1_pieces++;
                else plan2_pieces++;
            }
            else{
                if(curTile == '0') plan1_pieces++;
                else plan2_pieces++;
            }
        }

        System.out.println(Math.min(plan1_pieces, plan2_pieces));
    }
} import java.util.Scanner; Scanner java.util public class Main{
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        String tile = sc.nextLine();
        sc.close();

        int tile_length = tile.length();
        int plan1_pieces = 0;
        int plan2_pieces = 0;

        for(int i = 0; i < tile_length; i++){
            char curTile = tile.charAt(i);
            if(i % 2 == 0){
                if(curTile == '1') plan1_pieces++;
                else plan2_pieces++;
            }
            else{
                if(curTile == '0') plan1_pieces++;
                else plan2_pieces++;
            }
        }

        System.out.println(Math.min(plan1_pieces, plan2_pieces));
    }
} Main public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        String tile = sc.nextLine();
        sc.close();

        int tile_length = tile.length();
        int plan1_pieces = 0;
        int plan2_pieces = 0;

        for(int i = 0; i < tile_length; i++){
            char curTile = tile.charAt(i);
            if(i % 2 == 0){
                if(curTile == '1') plan1_pieces++;
                else plan2_pieces++;
            }
            else{
                if(curTile == '0') plan1_pieces++;
                else plan2_pieces++;
            }
        }

        System.out.println(Math.min(plan1_pieces, plan2_pieces));
    } main {
        Scanner sc = new Scanner(System.in);
        String tile = sc.nextLine();
        sc.close();

        int tile_length = tile.length();
        int plan1_pieces = 0;
        int plan2_pieces = 0;

        for(int i = 0; i < tile_length; i++){
            char curTile = tile.charAt(i);
            if(i % 2 == 0){
                if(curTile == '1') plan1_pieces++;
                else plan2_pieces++;
            }
            else{
                if(curTile == '0') plan1_pieces++;
                else plan2_pieces++;
            }
        }

        System.out.println(Math.min(plan1_pieces, plan2_pieces));
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String tile = sc.nextLine(); tile sc.nextLine() sc.nextLine sc sc.close() sc.close sc int tile_length = tile.length(); tile_length tile.length() tile.length tile int plan1_pieces = 0; plan1_pieces 0 int plan2_pieces = 0; plan2_pieces 0 for(int i = 0; i < tile_length; i++){
            char curTile = tile.charAt(i);
            if(i % 2 == 0){
                if(curTile == '1') plan1_pieces++;
                else plan2_pieces++;
            }
            else{
                if(curTile == '0') plan1_pieces++;
                else plan2_pieces++;
            }
        } int i = 0; int i = 0; i 0 i < tile_length i tile_length i++ i++ i {
            char curTile = tile.charAt(i);
            if(i % 2 == 0){
                if(curTile == '1') plan1_pieces++;
                else plan2_pieces++;
            }
            else{
                if(curTile == '0') plan1_pieces++;
                else plan2_pieces++;
            }
        } {
            char curTile = tile.charAt(i);
            if(i % 2 == 0){
                if(curTile == '1') plan1_pieces++;
                else plan2_pieces++;
            }
            else{
                if(curTile == '0') plan1_pieces++;
                else plan2_pieces++;
            }
        } char curTile = tile.charAt(i); curTile tile.charAt(i) tile.charAt tile i if(i % 2 == 0){
                if(curTile == '1') plan1_pieces++;
                else plan2_pieces++;
            }
            else{
                if(curTile == '0') plan1_pieces++;
                else plan2_pieces++;
            } i % 2 == 0 i % 2 i 2 0 {
                if(curTile == '1') plan1_pieces++;
                else plan2_pieces++;
            } if(curTile == '1') plan1_pieces++;
                else plan2_pieces++; curTile == '1' curTile '1' plan1_pieces++ plan1_pieces plan2_pieces++ plan2_pieces {
                if(curTile == '0') plan1_pieces++;
                else plan2_pieces++;
            } if(curTile == '0') plan1_pieces++;
                else plan2_pieces++; curTile == '0' curTile '0' plan1_pieces++ plan1_pieces plan2_pieces++ plan2_pieces System.out.println(Math.min(plan1_pieces, plan2_pieces)) System.out.println System.out System System.out Math.min(plan1_pieces, plan2_pieces) Math.min Math plan1_pieces plan2_pieces String args[] args public class Main{
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        String tile = sc.nextLine();
        sc.close();

        int tile_length = tile.length();
        int plan1_pieces = 0;
        int plan2_pieces = 0;

        for(int i = 0; i < tile_length; i++){
            char curTile = tile.charAt(i);
            if(i % 2 == 0){
                if(curTile == '1') plan1_pieces++;
                else plan2_pieces++;
            }
            else{
                if(curTile == '0') plan1_pieces++;
                else plan2_pieces++;
            }
        }

        System.out.println(Math.min(plan1_pieces, plan2_pieces));
    }
} public class Main{
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        String tile = sc.nextLine();
        sc.close();

        int tile_length = tile.length();
        int plan1_pieces = 0;
        int plan2_pieces = 0;

        for(int i = 0; i < tile_length; i++){
            char curTile = tile.charAt(i);
            if(i % 2 == 0){
                if(curTile == '1') plan1_pieces++;
                else plan2_pieces++;
            }
            else{
                if(curTile == '0') plan1_pieces++;
                else plan2_pieces++;
            }
        }

        System.out.println(Math.min(plan1_pieces, plan2_pieces));
    }
} Main
import java.util.Scanner;

public class Main{
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        String tile = sc.nextLine();
        sc.close();

        int tile_length = tile.length();
        int plan1_pieces = 0;
        int plan2_pieces = 0;

        for(int i = 0; i < tile_length; i++){
            char curTile = tile.charAt(i);
            if(i % 2 == 0){
                if(curTile == '1') plan1_pieces++;
                else plan2_pieces++;
            }
            else{
                if(curTile == '0') plan1_pieces++;
                else plan2_pieces++;
            }
        }

        System.out.println(Math.min(plan1_pieces, plan2_pieces));
    }
}
