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

/**
 * Created by user on 23.09.2016.
 */
public class B {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();

        String a = scanner.next();
        char[] mas = a.toCharArray();
        if (n == 1) {
            System.out.println(0);
            return;
        }
        int ans = 0;
        for (int i = 1; i + 1 < n; i++) {
            if (mas[i] == mas[i - 1] && mas[i + 1] == mas[i]) {
                ans++;
                if (mas[i] == 'r')
                    mas[i] = 'b';
                else mas[i] = 'r';
            } else if (mas[i] == mas[i - 1]) {
                ans++;
                char as = mas[i];
                mas[i] = mas[i + 1];
                mas[i + 1] = as;
            }
        }
        if (mas[n - 1] == mas[n - 2]) {
            ans = (ans + 1);
        } else {
        }
        int ansP = 1;
        mas = a.toCharArray();
        if (mas[0] == 'r')
            mas[0] = 'b';
        else mas[0] = 'r';
        for (int i = 1; i + 1 < n; i++) {
            if (mas[i] == mas[i - 1] && mas[i + 1] == mas[i]) {
                ansP++;
                if (mas[i] == 'r')
                    mas[i] = 'b';
                else mas[i] = 'r';
            } else if (mas[i] == mas[i - 1]) {
                ansP++;
                char as = mas[i];
                mas[i] = mas[i + 1];
                mas[i + 1] = as;
            }
        }
        if (mas[n - 1] == mas[n - 2]) {
            ansP = (ans + 1);
        } else {
        }
        System.out.println(Math.min(ans, ansP));
    }
}
