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 whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
public class Main{

     public static void main(String []args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        char[] s = sc.next().toCharArray();
        int r = 0;
        int b = 0;
        for(int i = 0;i<n;++i){
            if( i%2 ==0 && s[i] != 'r'){
                if(i<n-1 && s[i+1] == 'r'){ //swap
                    
                    s[i+1] = 'b';
                }
                r++;
            }
            else if(i%2 == 1 && s[i] != 'b'){
                if(i<n-1 && s[i+1] == 'b'){ //swap
                    
                    s[i+1] = 'r';
                }
                r++;
            }
        }
        
        for(int i = 0;i<n;++i){
            if( i%2 ==0 && s[i] != 'b'){
                if(i<n-1 && s[i+1] == 'b'){ //swap
                    
                    s[i+1] = 'r';
                }
                b++;
            }
            else if(i%2 == 1 && s[i] != 'r'){
                if(i<n-1 && s[i+1] == 'r'){ //swap
                    
                    s[i+1] = 'b';
                }
                b++;
            }
        }
        System.out.println(Math.min(b,r));
     }
}