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

//package codeforces;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

/**
 * Created by nitin.s on 11/12/16.
 */
public class AnatolyAndCockroaches {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        in.nextLine();
        String s = in.nextLine();
        StringBuilder first = new StringBuilder();
        StringBuilder second = new StringBuilder();
        char prev = 'b';
        for(int i = 0; i < n; ++i) {
            first.append(prev);
            if(prev == 'b') prev = 'r';
            else prev = 'b';
        }
        prev = 'r';
        for(int i = 0; i < n; ++i) {
            second.append(prev);
            if(prev == 'r') prev = 'b';
            else prev = 'r';
        }
        int answer1 = 0, answer2 = 0;
        List<Integer> tmp1 = new ArrayList<>();
        for(int i = 0; i < n; ++i) {
            if(s.charAt(i) != first.charAt(i)) {
                ++answer1;
                tmp1.add(i);
            }
        }
        List<Integer> tmp2 = new ArrayList<>();
        for(int i = 0; i < n; ++i) {
            if(s.charAt(i) != second.charAt(i)) {
                ++answer2;
                tmp2.add(i);
            }
        }
        int pair1 = 0, pair2 = 0;
        for(int i = 1; i < tmp1.size(); ++i) {
            if(tmp1.get(i) - tmp1.get(i - 1) == 1) ++pair1;
        }
        for(int i = 1; i < tmp2.size(); ++i) {
            if(tmp2.get(i) - tmp2.get(i - 1) == 1) ++pair2;
        }
        answer1 = (answer1 - pair1) + (pair1 / 2);
        answer2 = (answer2 - pair2) + (pair2 / 2);
        int answer = Math.min(answer1, answer2);
        System.out.println(answer);
    }
}
