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;
//
public class AnatolyAndCockroaches {
	public static void main(String[] args) {
		Scanner sc  = new Scanner(System.in);
		int n = sc.nextInt();
		String s = sc.next();
		int red = s.length() - s.replace("r", "").length();
		int black = s.length() - s.replace("b", "").length();
		int tkn =  Math.abs(red-black)/2;
		int cnt = tkn;
		char start = s.charAt(0);
//		char[] a = s.toCharArray();
		int swap = 0;
		for (int i = 0; i < s.length(); i++) {
//			if(s.charAt(i) == 'r')
			if(s.charAt(i) != start)
			{
				if(tkn>0)
					tkn--;
				else
				if(swap >0)
					swap--;
				else
				{
					cnt++;
					swap++;
				}
					
			}
			start = start =='r'?'b':'r';
			
		}
		System.out.println(cnt);
	}
}
