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.nextLine();
        a = scanner.nextLine();
        char[] mas = a.toCharArray();
        String rb = "";
        String br = "";
        StringBuilder stringBuilder = new StringBuilder();
        StringBuilder stringBuilder1 = new StringBuilder();
        for (int i = 0; i < a.length(); i++) {
            if (i % 2 == 0) {
                stringBuilder.append("r");
                stringBuilder1.append("b");
            } else {
                stringBuilder.append("b");
                stringBuilder1.append("r");
            }
        }
        rb = stringBuilder.toString();
        br = stringBuilder1.toString();
        int b = 0;
        int r = 0;
        for (int i = 0; i < n; i++) {
            if (mas[i] != rb.charAt(i)) {
                if (mas[i] == 'r') {
                    r++;
                } else {
                    b++;
                }
            }
        }
        int ans = Math.max(b, r);
        b = 0;
        r = 0;
        for (int i = 0; i < n; i++) {
            if (mas[i] != br.charAt(i)) {
                if (mas[i] == 'r') {
                    r++;
                } else {
                    b++;
                }
            }
        }
        System.out.println(Math.min(ans, Math.max(r, b)));
    }
}