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.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;


public class CF721B {
public static void main(String []args) {
      MyScanner in = new MyScanner();
      out = new PrintWriter(new BufferedOutputStream(System.out));
      //Start your solution from here.
      int n = in.nextInt();
      char [] ar = in.next().toCharArray();
      boolean f = false;
      int nr = 0;
      int nb = 0;
      for(int i=0;i<n;++i){
    	  if(ar[i]=='r'){
    		  nr++;
    	  }
    	  else{
    		  nb++;
    	  }
      }
      if(nr==nb){
    	  f = true;
      }
      else if(n%2==0 && (nr+1==nb || nb+1==nr)){
    	  f = true;
      }
      int br = 0;
      int bb = 0;
      int count = 0;
      if(n%2==0){
    	  if(nr>nb){
    		   for(int i=0;i<n;++i){
    			   if(i%2!=0 && ar[i]=='r'){
    				   br++;
    			   }
    			   if(i%2!=1 && ar[i]=='b'){
    				   bb++;
    			   }
    		   }
    		     count += Math.min(br, bb);
    		     if(f==false){
    		     count += ((nr-nb)/2);
    		     }
    	  }
    	  if(nr<nb){
   		   for(int i=0;i<n;++i){
   			   if(i%2!=0 && ar[i]=='b'){
   				   bb++;
   			   }
   			   if(i%2!=1 && ar[i]=='r'){
   				   br++;
   			   }
   		   }
   		     count += Math.min(br, bb);
   		     if(f==false)
   		     count += ((nb-nr)/2);
   	  }
    	  if(nb==nr){
    		  if(ar[0]=='b'){
    			  for(int i=0;i<n;++i){
    	   			   if(i%2!=0 && ar[i]=='b'){
    	   				   bb++;
    	   			   }
    	   			   if(i%2!=1 && ar[i]=='r'){
    	   				   br++;
    	   			   }
    	   		   }
    	   		     count += Math.min(br, bb);
    		  }
    		  else{
    			  for(int i=0;i<n;++i){
       			   if(i%2!=0 && ar[i]=='r'){
       				   br++;
       			   }
       			   if(i%2!=1 && ar[i]=='b'){
       				   bb++;
       			   }
       		   }
       		     count += Math.min(br, bb);
    		  }
    	  }
      }
      else{
    	  if(nr>nb){
   		   for(int i=0;i<n;++i){
   			   if(i%2!=0 && ar[i]=='r'){
   				   br++;
   			   }
   			   if(i%2!=1 && ar[i]=='b'){
   				   bb++;
   			   }
   		   }
   		     count += Math.min(br, bb);
   		     if(f==false){
   		     count += ((nr-nb)/2);
   		     }
   	  }
    	  if(nr<nb){
      		   for(int i=0;i<n;++i){
      			   if(i%2!=0 && ar[i]=='b'){
      				   bb++;
      			   }
      			   if(i%2!=1 && ar[i]=='r'){
      				   br++;
      			   }
      		   }
      		     count += Math.min(br, bb);
      		     if(f==false)
      		     count += ((nb-nr)/2);
      	  }
      }
      out.println(count);
      //End your solution here.       
      out.close();
   }
 
 

   //-----------PrintWriter for faster output---------------------------------
   public static PrintWriter out;

   //-----------MyScanner class for faster input----------
   public static class MyScanner {
      BufferedReader br;
      StringTokenizer st;

      public MyScanner() {
         br = new BufferedReader(new InputStreamReader(System.in));
      }

      String next() {
          while (st == null || !st.hasMoreElements()) {
              try {
                  st = new StringTokenizer(br.readLine());
              } catch (IOException e) {
                  e.printStackTrace();
              }
          }
          return st.nextToken();
      }

      int nextInt() {
          return Integer.parseInt(next());
      }

      long nextLong() {
          return Long.parseLong(next());
      }

      double nextDouble() {
          return Double.parseDouble(next());
      }
      char nextChar()  {
    	  try {
			return br.readLine().charAt(0);
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return 0 ;
      }
      int [] nextIntAr(int [] ar){
    	  for(int i=0;i<ar.length;++i){
    		  ar[i] = Integer.parseInt(next());
    	  }
    	  return ar;
      }
      long [] nextLongAr(long [] ar){
    	  for(int i=0;i<ar.length;++i){
    		  ar[i] = Long.parseLong(next());
    	  }
    	  return ar;
      }
      double [] nextDoubleAr(double [] ar){
    	  for(int i=0;i<ar.length;++i){
    		  ar[i] = Double.parseDouble(next());
    	  }
    	  return ar;
      }
      String [] nextStringAr(String [] ar){
    	  for(int i=0;i<ar.length;++i){
    		  ar[i] = next();
    	  }
    	  return ar;
      }

      String nextLine(){
          String str = "";
      try {
         str = br.readLine();
      } catch (IOException e) {
         e.printStackTrace();
      }
      return str;
      }

   }
}