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.math.BigInteger;
import java.util.*;



public class JavaApplication7 {
  
    public static void main(String[] args) throws Exception
    {
      Reader.init(System.in);
      
      int n = Reader.nextInt() ;
      String x = Reader.next() ;
      StringBuilder s1 = new StringBuilder() ;
      StringBuilder s2 = new StringBuilder() ;
     
      int sw1 = 0 ;
      int sw2 = 0 ;
      for(int i = 0 ; i < n ; i++)
          if(i % 2 == 0)
          s1.append("r") ;
          else s1.append("b") ;
      
      for(int i = 0 ; i < n ; i++)
          if(i % 2 != 0)
          s2.append("r") ;
          else s2.append("b") ;
       boolean ar1[] = new boolean[n] ;
       boolean ar2 [] = new boolean[n] ;
       for(int i = 0 ; i < n ; i++)
           if(x.charAt(i) != s1.charAt(i))
               ar1[i] = true ;
        for(int i = 0 ; i < n ; i++)
           if(x.charAt(i) != s2.charAt(i))
               ar2[i] = true ;
    
       
      for(int i = 0 ; i < n ; i++)
          if(ar1[i])
                  if(i+1 < n &&ar1[i+1])
                  {sw1++ ; i++;} 
                  else sw1++;
        
     for(int i = 0 ; i < n ; i++)
          if(ar2[i])
                  if(i+1 < n &&ar2[i+1])
                  {sw2++ ; i++;} 
                  else sw2++;
        System.out.println(Math.min(sw2, sw1));
}
        
    
    
    class pair implements Comparable<pair>
    {
     long  mod,pr , w; 
     long  san ; 
    pair( long b  , long x)
    {
   
    
    
    mod = b ;
    san = x ;
  
    }
    @Override
    public int compareTo(pair t) {
        if(t.san <san)
            return 1 ;
        else if(t.san > san) return -1 ;
        else return 0 ;
    }
    
    
    
    }
} 
   
    
class Reader {
    static BufferedReader reader;
    static StringTokenizer tokenizer;

    
    static void init(InputStream input) {
        reader = new BufferedReader(
                     new InputStreamReader(input) );
        tokenizer = new StringTokenizer("");
    }

   
    static String next() throws IOException {
        while ( ! tokenizer.hasMoreTokens() ) {
            
            tokenizer = new StringTokenizer(
                   reader.readLine() );
        }
        return tokenizer.nextToken();
    }

    static int nextInt() throws IOException {
        return Integer.parseInt( next() );
    }
	
    static double nextDouble() throws IOException {
        return Double.parseDouble( next() );
    }
    static long nextLong() throws IOException{
    return Long.parseLong(next()) ;
    }
}