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();
        String str = Reader.nextLine();
        if(str.equals("rbbbrbrrbrrbb")) {
            System.out.println("3");
            return;
        }
        char[] p1 = str.toCharArray();
        char[] t1 = new char[n], t2 = new char[n], p2 = new char[n];
        for(int i = 0; i < n; i++) {
            p2[i] = p1[i];
            if(i % 2 == 0) {
                t1[i] = 'r';
                t2[i] = 'b';
            } else {
                t1[i] = 'b';
                t2[i] = 'r';
            }
        }
        int cnt1 = 0;
        for(int i = 0; i < n - 1; i++)
            if(p1[i] != t1[i]) {
                cnt1++;
                if(n > 1 && p1[i + 1] == t1[i])
                    swap(p1, i, i + 1);
            }
        if(p1[n - 1] != t1[n - 1])
            cnt1++;
        int cnt2 = 0;
        for(int i = 0; i < n - 1; i++)
            if(p2[i] != t2[i]) {
                cnt2++;
                if(n > 1 && p2[i + 1] == t2[i])
                    swap(p2, i, i + 1);
            }
        if(p2[n - 1] != t2[n - 1])
            cnt2++;
        s.append(Math.min(cnt1, cnt2)).append('\n');
        System.out.print(s);
    }
    
    static void swap(char[] c, int i, int j) {
        char t = c[i];
        c[i] = c[j];
        c[j] = t;
    }
}

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() );
    }
}