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

import java.awt.Point;
import java.io.*;
import java.util.*;

public final class Main {
    BufferedReader br;
    StringTokenizer stk;

    public static void main(String[] args) throws Exception {
        new Main().run();
    }
    
    {
        stk = null;
        br = new BufferedReader(new InputStreamReader(System.in));
    }
    
    long mod = 998244353;
    
    void run() throws Exception {
        int n = ni();
        char[] c = nt().toCharArray();
        char[] r = new char[n];
        char[] b = new char[n];
        r[0] = 'r';
        b[0] = 'b';
        for(int i = 1; i < n; i++) {
            r[i] = r[i - 1] == 'r' ? 'b' : 'r';
            b[i] = b[i - 1] == 'b' ? 'r' : 'b';
        }
        
        int min = Integer.MAX_VALUE;
        min = Math.min(min, compute(Arrays.copyOf(c, n), r));
        min = Math.min(min, compute(Arrays.copyOf(c, n), b));
        
        System.out.println(min);
    }
    
    int compute(char[] o, char[] a) {
        int n = o.length;
        int black = 0, red = 0;
        for(int i = 0; i < n; i++) {
            if(o[i] != a[i]) {
                if(o[i] == 'r')
                    black++;
                else
                    red++;
            }
        }
        return Math.max(red, black);
    }
    
    //Reader & Writer
    String nextToken() throws Exception {
        if (stk == null || !stk.hasMoreTokens()) {
            stk = new StringTokenizer(br.readLine(), " ");
        }
        return stk.nextToken();
    }

    String nt() throws Exception {
        return nextToken();
    }

    int ni() throws Exception {
        return Integer.parseInt(nextToken());
    }

    long nl() throws Exception {
        return Long.parseLong(nextToken());
    }
    
    double nd() throws Exception {
        return Double.parseDouble(nextToken());
    }
    
    //Some Misc methods
    long get(int l, int r, long[] a) {
        return l == 0 ? a[r] : a[r] - a[l - 1];
    }
    
    void shuffle(long[] a) {
        Random r = new Random();
        for(int i = 0; i < a.length; i++) {
            int idx = r.nextInt(a.length);
            long temp = a[i];
            a[i] = a[idx];
            a[idx] = temp;
        }
    }
    
    void reverse(char[] a) {
        for(int i = 0, j = a.length - 1; i < j; i++, j--) {
            char temp = a[i];
            a[i] = a[j];
            a[j] = temp;
        }
    }
}