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

public class Solution {

    public static void main(String[] args) throws Exception{
        //Scanner in = new Scanner(System.in);
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(System.out);
    
        
        int a = Integer.parseInt(in.readLine());
        int arr[] = new int[a];
        String s1 = in.readLine();
        boolean flag = false;
      //  int cc[] = new int[s1.length()];
        StringBuilder res = new StringBuilder();
        int j = 0;
        for(char c : s1.toCharArray())
        {
            if(c=='b')
                res.append("0");
            else 
               res.append("1");
            
        }    
        int count = 0;
        for(int i=0;i<s1.length();i++){
            if(res.charAt(i)=='0')
                count++;
        }
      
        if(count==a){
            out.println(count/2);
            out.close();
            return;
        }
           
        count = 0;
        
        for(int i=0;i<s1.length();i++){
             if(res.charAt(i)=='1')
                count++;
        }
      
         if(count==a){
            out.println(count/2);
            out.close();
            return;
        }
           
        StringBuilder ss = new StringBuilder();
        int ans = 0;
        int ans1 = 0;
        
        for(int i=0;i<s1.length();i++){
            
            if(i%2==0)
                ss = ss.append("0");
            else
                ss = ss.append("1");
        }
       // out.println(ss.toString());
       // String s2 = new String(cc);
        for(int i=0;i<s1.length();i++){
          // out.println(cc[i]+ "" +ss.toString().charAt(i));
            
            if(res.toString().charAt(i)!=ss.toString().charAt(i))
                ans++;
            
        }
        
        ss = new StringBuilder();
        
        for(int i=0;i<s1.length();i++){
            
            if(i%2==0)
                ss = ss.append("1");
            else
                ss = ss.append("0");
        }
       
          
        for(int i=0;i<s1.length();i++){
        //    out.print(cc[i]+ "");
          //   out.println(cc[i]+ "" +ss.toString().charAt(i));
            if(res.toString().charAt(i)!=ss.toString().charAt(i))
                ans1++;
            
        }
      //  out.println(ans);
        //out.println(ans1);
        if(ans==0 || ans1==0)
            out.println("0");
        else
            out.println(Math.min(ans,ans1)-1);
        out.close();
        
    }
    
}

        /*
        
        String s = in.readLine();
        s = s.trim().toLowerCase();
        int len = s.length();
        int freq[] = new int[26];
        if(len<26)
            out.println("-1");
        
        else if(len>26){
        
          //  out.println(len);
            boolean flag = false;
                             boolean flag1 = false;
            int j = 0;
            int count = 0;
            
            for(int i=0;i<len;i++){
                
                if(s.charAt(i)=='?')
                    count++;
                
                if(s.charAt(i)!='?'){
                freq[s.charAt(i)-'a']++;
                count++;
                }
                
                if(s.charAt(i)!='?' && freq[s.charAt(i)-'a']>1){
                    
                    while(freq[s.charAt(i)-'a']!=1)
                    {
                        j++;
                        count--;
                        freq[s.charAt(i)-'a']--;
                      //  s = s.substring(0,i) + 'a' + s.substring(i);
                        //out.println(s);
                    }
                    
                }
                
            //   out.println("count" + count + " " + j + "i " + i);

            if(count==26){
                
            flag = true;
            HashSet<Character> set = new HashSet<Character>();
              //HashSet<Character> set1 = new HashSet<Character>();
            ArrayList<Character> set1 = new ArrayList<Character>();
           
            for(int l=j;l<i+1;l++)
            {
                char c = s.charAt(l);
                
                if(c=='?')
                    continue;
               
                else{
                    if(set.contains(c))
                    {
                        out.println("-1");
                        flag1 = true;
                        break;
                    }
                    set.add(c);
                    
                }
            }
            
            String s1 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
            s1 = s1.toLowerCase();
            
            for(char c : s1.toCharArray())
            {
                if(!set.contains(c))
                    set1.add(c);
            }
            
            for(int l=j;l<i+1;l++){
                
                if(s.charAt(l)!='?')
                    continue;
                else{
                   // out.println(s.substring(0,i) + "0 to i");
                   // out.println(s.substring(i+1) + "i");
                   // out.println(set1.get(0) + " set ");
                    s = s.substring(0,l) + set1.remove(0) + s.substring(l+1);
                    
                }
            }
                j = i+1;
                count = 0;
                Arrays.fill(freq,0);
                set.clear();
                set1.clear();
                }
                
            }
            if(flag && !s.contains("?"))
                out.println(s.toUpperCase());
            else if(!flag1)
                out.println("-1");
        }
        else if(len==26){
            
            HashSet<Character> set = new HashSet<Character>();
              //HashSet<Character> set1 = new HashSet<Character>();
            ArrayList<Character> set1 = new ArrayList<Character>();
            s = s.toLowerCase(); 
            for(char c:s.toCharArray())
            {
                if(c=='?')
                    continue;
               
                else{
                    if(set.contains(c))
                    {
                        out.println("-1");
                        break;
                    }
                    set.add(c);
                    
                }
            }
            
            String s1 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
            s1 = s1.toLowerCase();
            for(char c : s1.toCharArray())
            {
                if(!set.contains(c))
                    set1.add(c);
            }
            
            for(int i=0;i<len;i++){
                
                if(s.charAt(i)!='?')
                    continue;
                else{
                   // out.println(s.substring(0,i) + "0 to i");
                   // out.println(s.substring(i+1) + "i");
                   // out.println(set1.get(0) + " set ");
                    s = s.substring(0,i) + set1.remove(0) + s.substring(i+1);
                    
                }
            }
            
            out.println(s.toUpperCase());
          
        }
       out.close();
               
    }
}

*/
        
        
/*
        String s1[] = in.readLine().split(" ");
        int a = Integer.parseInt(s1[0]);
        int b = Integer.parseInt(s1[1]);
        
        int arr[] = new int[a];
        String ss[] = in.readLine().split(" ");
        
        for(int i=0;i<a;i++){
            arr[i] = Integer.parseInt(ss[i]);
        }
        
        int count = 0;
        
        for(int i=0;i<a-1;i++){
            
            if(Math.abs(arr[i]-arr[i+1])<=b)
               count++;
            
            else
                count = 0;
        }
        
        
        System.out.println(count+1);
        
    }
}
*/
        
  /*
        int t = in.nextInt();
        
        while(t-->0){
      
      long r = in.nextInt();
       long s = in.nextInt();
       long p = in.nextInt();
        long sum = 1;
            long ans = -1;
        for(int i=1;i<p;i++){
            
            sum += (Math.pow(r,i)%p);
           // System.out.println(sum);
            if((sum%p) == s%p)
            {
                ans = i+1;
                break;
            }
        }    
            
        
     
       System.out.println(ans);
    }
    }
}
*/
      /*  for(int i=0;i<n;i++){
            arr[i] = in.nextInt();
        }
        
        int min = Integer.MAX_VALUE;
        
        for(int i=0;i<n;i++){
            
            if(arr[i] >= n-i){
                
                min = Math.min(i,min);
            }
        }   
        
        System.out.println(min+1);
        
    }
}
        
        */
    
/*
        int n = in.nextInt();
        //int m = in.nextInt();
        int arr[] = new int[n+1];
        int arr1[] = new int[n+1];
        
        for(int i=1;i<=n;i++){
            arr[i] = in.nextInt();
        }
        
        for(int i=1;i<=n;i++){
            arr1[i] = in.nextInt();
        }
        
        int freq[] = new int[n+1];
        int n1 = -1;
        int n2 = -1;
        boolean flag = false;
        
        for(int i=1;i<=n;i++){
                   

            if(freq[arr[i]]>0 && !flag){
               // System.out.println(i);       
                n2 = i;
                n1 = arr[i];
                flag = true;
            }
            freq[arr[i]]++;
        }
                

        int miss = -1;
        int repeat = -1;
    flag = false;
        for(int i=1;i<=n;i++){
            if(arr[i]==n1 && i!=n2 && !flag){
                n1 = i;
                //System.out.println(n1 + " " +n2);       
                repeat = arr[i];
                flag = true;

            }
            if(freq[i]==0)
                miss = i;
        }
        

        arr[n1] = miss;
        
        int count = 0;
        
        for(int i=1;i<=n;i++){
            
            if(arr[i] != arr1[i])
                count++;
        }
        
        if(count>1){
            arr[n1] = repeat;
            arr[n2] = miss;
        }
        
        for(int i=1;i<=n;i++){
            System.out.print(arr[i] + " ");
        }
    }
}
*/
        