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 pkg373b2;

import java.util.*;

public class Main {

    public static int n;
    public static String s;
    public static int Res;
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt(); sc.nextLine();
        s = sc.nextLine();
        char[] a = s.toCharArray();
        int Start = 1;
        int Count0 = 0, Count1 = 0;
        //Black = 0, red = 1
        for(int i = 0; i < n; i++){
            int d;
            if(a[i] == 'b') d = 0; else d = 1;
            if(d != Start){
                if(d == 0) Count0++;
                else Count1++;
            }
            Start = 1 - Start;
        }
        Res = Math.abs(Count1 - Count0) + Math.min(Count0, Count1);
        Start = 0; Count0 = 0; Count1 = 0;
        for(int i = 0; i < n; i++){
            int d;
            if(a[i] == 'b') d = 0; else d = 1;
            if(d != Start){
                if(d == 0) Count0++;
                else Count1++;
            }
            Start = 1 - Start;
        }
        Res = Math.min(Res, Math.abs(Count1 - Count0) + Math.min(Count0, Count1));
        System.out.println(Res);
    }
    
}
