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.util.ArrayList;
import java.util.Scanner;


public class a373b {
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String ss = sc.next();
        int limit = ss.length();
        char next='z' , prev= 'z';
        int countb = 0;
        int countr = 0;
        int count = 0;
        ArrayList<Character> s = new ArrayList<Character>();
        ArrayList<Character> c = new ArrayList<Character>();
        for (int i = 0; i < limit; i++) {
            s.add(ss.charAt(i));
        }
        if (s.get(0)=='r') {
            for (int i = 0; i < limit; i++) {
                if (i%2==0)
                    c.add('r');
                else
                    c.add('b');
            }
        }
        else{
            for (int i = 0; i < limit; i++) {
                if (i%2==0) {
                    c.add('b');
                }
                else
                    c.add('r');
            }
        }
        for (int i = 0; i < limit; i++) {
            if (s.get(i)!=c.get(i)) {
                if (s.get(i)=='b') {
                    countb++;
                }
                else
                    countr++;
            }
        }
        System.out.println(Math.max(countb, countr));
    }
}
