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 Main{

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		String str = in.next();
		int rNum = 0 , bNum = 0,f = 0,sum;
		char ch,ch1;
		ch = str.charAt(0);
		for(int i = 1 ; i < n ; i++) {
			ch1 = str.charAt(i);
			if(ch == ch1) {
				if(ch1 == 'r') {
					rNum++;
					ch = 'b';
				}else {
					bNum++;
					ch = 'r';
				}
			}else {
				ch = ch1;
			}
		}
		if(rNum > bNum) {
			f = rNum - bNum;
			sum = bNum;
		}else if(rNum < bNum){
			f = bNum - rNum;
			sum = rNum;
		}else {
			sum = bNum;
		}
		sum += f;
		System.out.println(sum);
		in.close();
	}

}

  	 			  			     				 	   	  	