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.ArrayList;
import java.util.Scanner;

public class Main13 {



    public static void main(String[] args)  {
       Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        String s1 = scanner.next();
         n = s1.length()-1;
        StringBuilder s = new StringBuilder(s1);
        int i = 1, j = 1, count = 0;


        while (i < n || j < n){

            while (((i < n) & ((s.charAt(i) != s.charAt(i-1)) | s.charAt(i) != 'r'))) {
                i++;
            }
            while (((j < n) & ((s.charAt(j) != s.charAt(j-1)) | s.charAt(j) != 'b')))
                j++;

            if (i <= n && j <= n && s.charAt(i) != s.charAt(j)){
                s.deleteCharAt(i-1);
                s.insert(i-1, "b");
                s.deleteCharAt(j);
                s.insert(j, "r");
                count++;
            }
            if (i == n && s.charAt(i) == s.charAt(j)) break;
            if (j == n && s.charAt(i) == s.charAt(j)) break;

        }
        for (int k = 1; k < s.length(); k++) {
            if (s.charAt(k) == s.charAt(k-1)) {
                count++;
                if (s.charAt(k-1) == 'r') {
                    s.deleteCharAt(k);
                    s.insert(k, "b");
                }
                if (s.charAt(k-1) == 'b') {
                    s.deleteCharAt(k);
                    s.insert(k, "r");
                }
            }
        }
      //  System.out.println(s);
        System.out.println(count);




    }
}
