import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main  {
    public static void main(String[] args) throws Exception {
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        String tiles = input.readLine();
        System.out.println(Math.min(getCount(tiles, '0'), getCount(tiles, '1')));
    }

    public static int getCount(String tiles, char tile) {
        int count = 0;
        for (int i = 0; i < tiles.length(); i++) {
            if (tile != tiles.charAt(i))
                count++;
            tile = tile == '0' ? '1' : '0';
        }
        return count;
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main  {
    public static void main(String[] args) throws Exception {
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        String tiles = input.readLine();
        System.out.println(Math.min(getCount(tiles, '0'), getCount(tiles, '1')));
    }

    public static int getCount(String tiles, char tile) {
        int count = 0;
        for (int i = 0; i < tiles.length(); i++) {
            if (tile != tiles.charAt(i))
                count++;
            tile = tile == '0' ? '1' : '0';
        }
        return count;
    }
} Main public static void main(String[] args) throws Exception {
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        String tiles = input.readLine();
        System.out.println(Math.min(getCount(tiles, '0'), getCount(tiles, '1')));
    } main {
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        String tiles = input.readLine();
        System.out.println(Math.min(getCount(tiles, '0'), getCount(tiles, '1')));
    } BufferedReader input = new BufferedReader(new InputStreamReader(System.in)); input new BufferedReader(new InputStreamReader(System.in)) String tiles = input.readLine(); tiles input.readLine() input.readLine input System.out.println(Math.min(getCount(tiles, '0'), getCount(tiles, '1'))) System.out.println System.out System System.out Math.min(getCount(tiles, '0'), getCount(tiles, '1')) Math.min Math getCount(tiles, '0') getCount tiles '0' getCount(tiles, '1') getCount tiles '1' String[] args args public static int getCount(String tiles, char tile) {
        int count = 0;
        for (int i = 0; i < tiles.length(); i++) {
            if (tile != tiles.charAt(i))
                count++;
            tile = tile == '0' ? '1' : '0';
        }
        return count;
    } getCount {
        int count = 0;
        for (int i = 0; i < tiles.length(); i++) {
            if (tile != tiles.charAt(i))
                count++;
            tile = tile == '0' ? '1' : '0';
        }
        return count;
    } int count = 0; count 0 for (int i = 0; i < tiles.length(); i++) {
            if (tile != tiles.charAt(i))
                count++;
            tile = tile == '0' ? '1' : '0';
        } int i = 0; int i = 0; i 0 i < tiles.length() i tiles.length() tiles.length tiles i++ i++ i {
            if (tile != tiles.charAt(i))
                count++;
            tile = tile == '0' ? '1' : '0';
        } {
            if (tile != tiles.charAt(i))
                count++;
            tile = tile == '0' ? '1' : '0';
        } if (tile != tiles.charAt(i))
                count++; tile != tiles.charAt(i) tile tiles.charAt(i) tiles.charAt tiles i count++ count tile = tile == '0' ? '1' : '0' tile tile == '0' ? '1' : '0' tile == '0' tile '0' '1' '0' return count; count String tiles tiles char tile tile public class Main  {
    public static void main(String[] args) throws Exception {
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        String tiles = input.readLine();
        System.out.println(Math.min(getCount(tiles, '0'), getCount(tiles, '1')));
    }

    public static int getCount(String tiles, char tile) {
        int count = 0;
        for (int i = 0; i < tiles.length(); i++) {
            if (tile != tiles.charAt(i))
                count++;
            tile = tile == '0' ? '1' : '0';
        }
        return count;
    }
} public class Main  {
    public static void main(String[] args) throws Exception {
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        String tiles = input.readLine();
        System.out.println(Math.min(getCount(tiles, '0'), getCount(tiles, '1')));
    }

    public static int getCount(String tiles, char tile) {
        int count = 0;
        for (int i = 0; i < tiles.length(); i++) {
            if (tile != tiles.charAt(i))
                count++;
            tile = tile == '0' ? '1' : '0';
        }
        return count;
    }
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main  {
    public static void main(String[] args) throws Exception {
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        String tiles = input.readLine();
        System.out.println(Math.min(getCount(tiles, '0'), getCount(tiles, '1')));
    }

    public static int getCount(String tiles, char tile) {
        int count = 0;
        for (int i = 0; i < tiles.length(); i++) {
            if (tile != tiles.charAt(i))
                count++;
            tile = tile == '0' ? '1' : '0';
        }
        return count;
    }
}
