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.*;
import java.lang.*;
import java.io.*;

public class Ideone
{
	public static void main(String[] args) throws IOException
	{
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		String given=sc.next();
		char a=given.charAt(0);
		int black, red, blackOc=0, turns=0;
		if(n%2==0){
			black=n/2;
			red=black;
		}
		else{
			if(a=='r'){
				black=(n-1)/2;
				red=black+1;
			}
			else{
				red=(n-1)/2;
				black=red+1;
			}
		}
		for(int i=1;i<=given.length();i++){
			if(i%2==0 && given.charAt(i-1)==a)
				turns++;
			else if(i%2!=0 && given.charAt(i-1)!=a)
				turns++;
			if(given.charAt(i-1)=='b')
				blackOc++;
		}
		int finalturn=0;
		if(turns!=0){
			if(blackOc==black)
				finalturn=turns/2;
			else if(blackOc>black){
				finalturn=(blackOc-black)+((turns-(blackOc-black))/2);
			}else{
				int redOc=given.length()-blackOc;
				finalturn=(redOc-red)+((turns-(redOc-red))/2);
			}
		}
		System.out.println(finalturn);
		sc.close();
	}
}