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.*;

/**
 * Created by naveen on 19-Dec-15.
 */
public class test {

    public static void main(String[] args) {

        Scanner scn = new Scanner(System.in);

        int n = Integer.parseInt(scn.nextLine());

        String str = scn.nextLine();

        boolean[] arr = new boolean[n];
        boolean[] ta = new boolean[n];
        boolean[] fa = new boolean[n];
        arr[0] = str.charAt(0) == 'r';
        ta[0] = true;
        fa[0] = false;

        for (int i = 1; i < n; i++) {
            arr[i] = str.charAt(i) == 'r';
            ta[i] = !ta[i-1];
            fa[i] = !fa[i-1];
        }

        int ftCount = 0, stCount = 0, count = 0, count1 = 0;

        for (int i = 0; i < n; i++) {
            if(arr[i]^ta[i]) {//different
                if(arr[i]) {
                    if(stCount > 0) {
                        stCount--;
                    }
                    else {
                        count++;
                        ftCount++;
                    }
                }
                else {
                    if(ftCount > 0) {
                        ftCount--;
                    }
                    else {
                        count++;
                        stCount++;
                    }
                }
            }
        }

        ftCount = stCount = 0;

        for (int i = 0; i < n; i++) {
            if(arr[i]^fa[i]) {//different
                if(arr[i]) {
                    if(stCount > 0) {
                        stCount--;
                    }
                    else {
                        count1++;
                        ftCount++;
                    }
                }
                else {
                    if(ftCount > 0) {
                        ftCount--;
                    }
                    else {
                        count1++;
                        stCount++;
                    }
                }
            }
        }

        System.out.println(Math.min(count, count1));
    }

}
