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 mainse {
	public static void main(String[] args){
    Scanner sc= new Scanner(System.in);
    
    	
    int n=sc.nextInt();
    sc.nextLine();
String s=sc.nextLine();
int count=0;
char c=s.charAt(0);
int countr=1;
int countb=0;
int r=0;
int b=0;
for(int i=1;i<n;i++){
	if(s.charAt(i)==c){
		countr++;
	}
	if(s.charAt(i)!=c){
		countb++;
	}
	
	if(i%2!=0&&s.charAt(i)==c){
		r++;
	}else{
	if(i%2==0&&s.charAt(i)!=c){
		b++;
	}}
}
int finalr=countr-r;
int finalb=countb-b;
int y=0;
if(finalr>finalb){
	y=finalr;
}
else{
	y=finalb;
}
int g=0;
if(b>=r){
	g=b;
}
else{
g=r;	
}
if(y<g){
	System.out.println(y);
}
else{
	System.out.println(g);
}
	}}
	
	

