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.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;
        int lastChange = -1;
        for(int i = 0; i < n; ++i) {
            if(s.charAt(i) == first.charAt(i)) continue;
            else {
                if(lastChange != -1) {
                    if(i - lastChange == 1) {
                        lastChange = -1;
                    } else {
                        lastChange = i;
                        ++answer1;
                    }
                } else {
                    lastChange = i;
                    ++answer1;
                }
            }
        }

        lastChange = -1;
        for(int i = 0; i < n; ++i) {
            if(s.charAt(i) == second.charAt(i)) continue;
            else {
                if(lastChange != -1) {
                    if(i - lastChange == 1) {
                        lastChange = -1;
                    } else {
                        lastChange = i;
                        ++answer2;
                    }
                } else {
                    lastChange = i;
                    ++answer2;
                }
            }
        }
        int answer = Math.min(answer1, answer2);
        System.out.println(answer);
    }
}
