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.Scanner;

/**
 *
 * @author toshiba
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {

        Scanner in = new Scanner(System.in);

        int n = in.nextInt();
        in.nextLine();
        StringBuilder s = new StringBuilder(in.nextLine());
        int r = -1;
        int b = -1;
        int g = 0;

        if (!s.toString().contains("r") || !s.toString().contains("b")) {
            g = n / 2;
        } else {
            do {
                r = -1;
                b = -1;
                for (int i = 1; i < s.length(); i++) {
                    if (s.charAt(i) == 'r' && s.charAt(i - 1) == 'r' && r==-1) {
                        r = i;
                        
                    }  if (s.charAt(i) == 'b' && s.charAt(i - 1) == 'b' && b==-1) {
                        b = i;
                    
                    }

                    if (r != -1 && b != -1) {
                        if (r < b) {
                           s.replace(r, r + 1, "b");
                            s.replace(b - 1, b, "r");
                        } else {
                           
                             s.replace(r - 1, r, "b");
                            s.replace(b, b + 1, "r"); 
                            
                        }
                        g++;
                        break;
                    }

                }
          
                if (r != -1 && b == -1) {
                    s.replace(r , r+1, "b");
                    g++;
                    
                } else if (r == -1 && b != -1) {
                    s.replace(b , b+1, "r");
                    g++;
                }

            } while (r != -1 || b != -1);
        }
     
        System.out.println(g);

    }

}
