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

//package acc;
import java.util.*;
import java.io.*;
import java.math.BigInteger;
//static Set<String> st=new TreeSet<String>();
//static Map<Integer,Integer> mp=new HashMap<Integer,Integer>();
//if(mp.get(a)==null)
//mp.put(a,ct++);


   public  class ACC { 
//************Main*****************//
      // static long arr1[]=new long[100001],m=0;
       static List <Integer>arr[]=new ArrayList[1011];
       //static int n=0;
       static int visit[]=new int [1011];
       static int ans[][]=new int [1011][1011];
       static void dfs(int k,int child){
               if(visit[child]!=0) return;
               visit[child]=1;
               ans[k][child]=1;
               for(int j=0;j<arr[child].size();j++){
                   int x=arr[child].get(j);
                   dfs(k,x);
               }
           
       }
         public static void main(String[] args) throws IOException
			 {
             //   PrintWriter out=new PrintWriter(new OutputStreamWriter(System.out));
                //Scanner in=new Scanner (System.in);
                InputStream inputStream = System.in;
                OutputStream outputStream = System.out;
                InputReader in = new InputReader(inputStream);
                PrintWriter out = new PrintWriter(outputStream);
                int n=in.nextInt();
                String s=in.next();
                char arr[]=new char[n];
                arr=s.toCharArray();
                char arr1[]=new char[n];
                char arr2[]=new char[n];
                for(int i=0;i<n;i++){
                    if(i%2==0) {
                        arr1[i]='r';
                        arr2[i]='b';
                    }
                    else {
                        arr1[i]='b';
                        arr2[i]='r';
                    }
                }
                int sum1=0;
                int sum2=0;
                for(int i=1;i<n;i++){
                    if(arr[i-1]!=arr1[i-1]){
                        if(arr[i]!=arr1[i]){
                           i++;
                           sum1++;
                        }
                        else sum1++;
                    }
                }
                for(int i=1;i<n;i++){
                    if(arr[i-1]!=arr2[i-1]){
                        if(arr[i]!=arr2[i]){
                           i++;
                           sum2++;
                        }
                        else sum2++;
                    }
                }
                out.print(Math.min(sum1, sum2));
                out.close();
         }
         
   }
    class Pair implements Comparable<Pair>{
    int x,y;
    public  Pair(int X,int Y){
        super();
x=X;
y=Y;
}
    @Override
      public int compareTo(Pair p){
          if((x)==(p.x)) return Integer.compare((y), (p.y));
       return Integer.compare((x), (p.x));
}
  }
class InputReader {
    private BufferedReader reader;
    private StringTokenizer tokenizer;

    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream));
        tokenizer = null;
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }
    public long nextLong(){
        return Long.parseLong(next());
    }
    double nextDouble() {
        return Double.parseDouble(next()); //To change body of generated methods, choose Tools | Templates.
    }
}