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 {

  
    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(noOfCockroachesMai(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 noOfCockroachesMai(int n, String row) {

        int counter = 0;
        int bStack = 0;
        int rStack = 0;

        int index = 0;
        // for rb sequance
        char lessOc;
        char muchOc;

        if ((countOccurrencesOf(row, "b") > countOccurrencesOf(row, "r"))) {
            lessOc = 'r';
            muchOc = 'b';
        }else {
            lessOc = 'b';
            muchOc = 'r';
        }

        for (int i = 0; i < n - 1; i += 2) {
            if (row.charAt(i) != lessOc) {
                if (rStack > 0) {
                    rStack--;
                    counter++;
                } else {
                    bStack++;
                }
            }
            if (row.charAt(i + 1) != muchOc) {
                if (bStack > 0) {
                    bStack--;
                    counter++;
                } else {
                    rStack++;
                }
            }
        }

        if (n % 2 != 0) {
            if (row.charAt(row.length() - 1) != lessOc) {
                if (rStack > 0) {
                    rStack--;
                    counter++;
                } else {
                    bStack++;
                }
            }
        }

        return counter + bStack + rStack;
    }

}
