166
rbbbbbbbbbbbbrbrrbbrbbbrbbbbbbbbbbrbbbbbbrbbbrbbbbbrbbbbbbbrbbbbbbbrbbrbbbbbbbbrbbbbbbbbbbbbbbrrbbbrbbbbbbbbbbbbbbrbrbbbbbbbbbbbrbbbbbbbbbbbbbbrbbbbbbbbbbbbbbbbbbbbbb
 7
rrbrbrb
 1
r
 2
bb
 18
rrrrrrrrrrrrrrrrrb
 8
rbbrbrbr
 1
b
 13
rbbbrbrrbrrbb
 100
brbbbrrrbbrbrbbrbbrbbbbrbbrrbbbrrbbbbrbrbbbbbbbbbbbbbbbbrrrrbbbbrrrbbbbbbbrbrrbrbbbbrrrbbbbrbbrbbbrb
 2
rb
 2
rr
 2
br

70
 1
 0
 1
 8
 1
 0
 3
 34
 0
 1
 0

import java.util.*;

/**
 * Created by kerolos.atallah on 07/02/2019.
 */
public class TestMain {

    int intField = 10;

    class InnerClass extends TestMain {

    }

    public static void main(String[] args) {

        try {
            Scanner sc = new Scanner(System.in);
            int n = sc.nextInt();
            String row = sc.next();
            if (n != row.length())
                return;


            System.out.println(noOfCockroaches(n, row));

        } catch (Exception e) {
            e.printStackTrace();
        }


    }

    public static int countOccurrencesOf(String str, String sub) {
        if (str != null && sub != null && str.length() != 0 && sub.length() != 0) {
            int count = 0;

            int idx;
            for (int pos = 0; (idx = str.indexOf(sub, pos)) != -1; pos = idx + sub.length()) {
                ++count;
            }

            return count;
        } else {
            return 0;
        }
    }

    static int noOfCockroaches(int n, String row) {
        String base;
        int counter = 0;
        int index = 0;
        
        boolean allBs = countOccurrencesOf(row, "b") > countOccurrencesOf(row, "r");

        if ((countOccurrencesOf(row, "br") > countOccurrencesOf(row, "rb")) || allBs) {
            base = "br";
        } else {
            base = "rb";
        }

        for (int i = 0; i < n / 2; i++) {
            if (row.substring(index, index + 2).equals(base)) {
                index += 2;
                continue;
            } else {
                index += 2;
                counter++;
            }
        }

        if (base.charAt(1) == row.charAt(row.length() - 1)) {
            counter++;
        }

        return counter;
    }
}