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.io.*;
public class A
{
      public static void main(String ar[]) throws Exception
      {
            BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
            int n=Integer.parseInt(br.readLine());
            char c[]=br.readLine().toCharArray();
            char cc[]=c.clone();
            char d1[]=new char[n];
            char d2[]=new char[n];
            
            for(int i=0;i<n;i++)
            {
                  if(i%2==0)
                  { d1[i]='r'; d2[i]='b'; }
                  else
                  { d1[i]='b'; d2[i]='r'; }
            }
            int x=0,y=0;
            int r=0,b=0;
            for(int i=0;i<n;i++)
            {
                  if(c[i]=='r' && c[i]!=d1[i])
                   r++;
                  else if(c[i]=='b' && c[i]!=d1[i])
                   b++;
            }
            
            x=Math.max(r,b);
            r=0;  b=0;
            
            for(int i=0;i<n;i++)
            {
                  if(c[i]=='r' && c[i]!=d2[i])
                   r++;
                  else if(c[i]=='b' && c[i]!=d2[i])
                   b++;
            }
            
            y=Math.max(r,b);
            System.out.println(Math.min(x,y));
      }
}