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.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.net.URISyntaxException;
import java.util.StringTokenizer;

public class Main {
    
    public static void main(String[] args)throws IOException, URISyntaxException {
        Reader.init(System.in);
        StringBuilder s=new StringBuilder();
        int n = Reader.nextInt();
        char[] p = Reader.nextLine().toCharArray();
        char[] t1 = new char[n], t2 = new char[n];
        for(int i = 0; i < n; i++) {
            t1[i] = i % 2 == 0 ? 'r' : 'b';
            t2[i] = i % 2 == 1 ? 'r' : 'b';
        }
        int r1 = 0, r2 = 0, b1 = 0, b2 = 0;
        for(int i = 0; i < n; i++) {
            if(p[i] != t1[i]) {
                if(p[i] == 'r')
                    r1++;
                else b1++;
            }
            if(p[i] != t2[i]) {
                if(p[i] == 'r')
                    r2++;
                else b2++;
            }
        }
        int min = Math.min(Math.max(r1, b1), Math.max(r2, b2));
        s.append(min).append('\n');
        System.out.print(s);
    }
}

class Reader {
    static BufferedReader reader;
    static StringTokenizer tokenizer;

    /** call this method to initialize reader for InputStream */
    static void init(InputStream input) throws UnsupportedEncodingException {
        reader = new BufferedReader(
                     new InputStreamReader(input, "UTF-8") );
        tokenizer = new StringTokenizer("");
    }

    /** get next word */
    static String next() throws IOException {
        while ( ! tokenizer.hasMoreTokens() ) {
            //TODO add check for eof if necessary
            tokenizer = new StringTokenizer(
                   reader.readLine() );
        }
        return tokenizer.nextToken();
    }
    
    static String nextLine() throws IOException {
        return reader.readLine();
    }

    static int nextInt() throws IOException {
        return Integer.parseInt( next() );
    }
    
    static double nextDouble() throws IOException {
        return Double.parseDouble( next() );
    }
    
    static long nextLong() throws IOException {
        return Long.parseLong( next() );
    }
}