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


//Mann Shah [ DAIICT ].[ Mann_27__ ] :) 


public class Main { 
	
	
	
	public static void main(String[] Args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		String ss = in.next();
		StringBuilder s = new StringBuilder(ss);
		
		//rsrsrsrs
		int cr=0,cb=0;
		char  x= 'r';
		int ans = 0;
		for(int i=0;i<n;i++) {
			if(s.charAt(i)!=x) {
				if(x=='r') {
					cr++;
				}
				else {
					cb++;
				}
			}
			x=(char)('r'+'b'-x);
		}
		ans = Math.max(cr,cb);
		
		
		//srsrsrsr
		int cr1=0,cb1=0;
		char  x1= 'b';
		int ans1 = 0;
		for(int i=0;i<n;i++) {
			if(s.charAt(i)!=x1) {
				if(x1=='r') {
					cr1++;
				}
				else {
					cb1++;
				}
			}
			x1=(char)('r'+'b'-x1);
		}
		ans1 = Math.max(cr1,cb1);
		
		System.out.println(Math.min(ans, ans1));
		
		in.close();
		
	}
}