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.*;

public class CodeForce {

    private static int r, b;

    public static void main(String[] args) {

        Scanner in = new Scanner(System.in);
        int size = in.nextInt();
        String name = in.next();

        char lastLetter = name.charAt(0);

        boolean lastChanged = false;
        for (int i = 1; i < size; ++i) {
            char thisLetter = name.charAt(i);
            if (lastLetter == thisLetter) {
                if (thisLetter == 'r') {

                    if (lastChanged&&i==2) {
                        
                        lastLetter = thisLetter;
                        continue;
                    } else {

                        lastLetter = 'b';
                        ++r;

                    }
                } else {
                    if (lastChanged&&i==2) {
                        lastLetter = thisLetter;
                        continue;
                    } else {
                        lastLetter = 'r';
                        ++b;

                    }
                }
                lastChanged = true;
            } else {
                lastLetter = thisLetter;
                lastChanged = false;
            }

        }
        int answer = Math.max(r, b);
        System.out.println(answer);

    }
}
