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.*;
 
public class Solution {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int N = Integer.parseInt(br.readLine());
        String s = br.readLine();
        System.out.println(solve(N,s));
    }
    
    private static int solve(int N,String s){
        int min1 = 0,min2 = 0;
        char x = 'b';
        int b=0,r=0;
        for(int i=0;i<N;++i){
            if(s.charAt(i) == 'b') b++;
            if(s.charAt(i) == 'r') r++;
            
            if(s.charAt(i) != x) min1++;
            x = x == 'b' ? 'r' : 'b';
        }
        
        x = 'r';
        for(int i=0;i<N;++i){
            if(s.charAt(i) != x) min2++;
            x = x == 'b' ? 'r' : 'b';
        }
        
        if(Math.abs(b-r) <= 1){
            min1 /= 2;
            min2 /= 2;
        }
        
        return Math.min(min1,min2);
    }
}