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.io.*;
import java.util.*;
import java.util.regex.*;
public class vk18
{
    public static void main(String[]stp) throws Exception
    {
    	Scanner scan=new Scanner(System.in);
    	PrintWriter pw = new PrintWriter(System.out);
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st=new StringTokenizer(br.readLine());
        int n=Integer.parseInt(st.nextToken()),count1=0,count2=0,ans1=0,ans2=0,i;
        char c1[]=new char[n];
        for(i=0;i<n;i++) { if(i%2==0) c1[i]='r'; else c1[i]='b'; }
        st=new StringTokenizer(br.readLine());
        char []c2=st.nextToken().toCharArray();
        for(i=0;i<n;i++)
        {
        	if(c1[i]!=c2[i])
        	{
        		if(c2[i]=='r') count1++;
        		else count2++;
        	}
        }
        ans1=Math.max(count1,count2);
        count1=0;count2=0;
        for(i=0;i<n;i++) { if(i%2==0) c1[i]='b'; else c1[i]='r'; }
        for(i=0;i<n;i++)
        {
        	if(c1[i]!=c2[i])
        	{
        		if(c2[i]=='r') count1++;
        		else count2++;
        	}
        }
        ans2=Math.max(count1,count2);
        //pw.println(count1+" "+count2+" "+ans1);
        pw.print(Math.min(ans1,ans2));
        pw.flush();
    }    
}