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.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Nasko
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        public void solve(int testNumber, InputReader in, PrintWriter out) {


            ArrayList<Integer> evenRed = new ArrayList<Integer>();
            ArrayList<Integer> oddRed = new ArrayList<Integer>();
            ArrayList<Integer> evenBlack = new ArrayList<Integer>();
            ArrayList<Integer> oddBlack = new ArrayList<Integer>();

            int N = in.nextInt();
            String s = in.nextLine();

            char[] a = s.toCharArray();
            char[] b = s.toCharArray();

            for (int i = 0; i < a.length; ++i) {
                if (a[i] == 'r') {
                    if (i % 2 == 0) {
                        evenRed.add(i);
                    } else {
                        oddRed.add(i);
                    }
                } else {
                    if (i % 2 == 0) {
                        evenBlack.add(i);
                    } else oddBlack.add(i);
                }
            }


            // black on even

            int blackOddId = 0;
            int redEvenId = 0;

            int retA = 0;
            int retB = 0;
            for (int i = 0; i < a.length; ++i) {

                if (i % 2 == 0) {
                    if (a[i] == 'b') continue;
                    if (blackOddId < oddBlack.size()) {
                        while (blackOddId < oddBlack.size() && (oddBlack.get(blackOddId) < i)) ++blackOddId;
                        if (blackOddId < oddBlack.size()) {
                            a[i] = 'b';
                            a[oddBlack.get(blackOddId)] = 'r';
                            ++blackOddId;
                            ++retA;
                        } else {
                            ++retA;
                        }
                    } else {
                        ++retA;
                    }
                } else {
                    if (a[i] == 'r') continue;
                    if (redEvenId < evenRed.size()) {
                        while (redEvenId < evenRed.size() && (evenRed.get(redEvenId) < i)) ++redEvenId;
                        if (redEvenId < evenRed.size()) {
                            a[i] = 'r';
                            a[evenRed.get(redEvenId)] = 'b';
                            ++redEvenId;
                            ++retA;
                        } else ++retA;
                    } else ++retA;
                }
            }

            int oddRedId = 0;
            int evenBlackId = 0;
            for (int i = 0; i < a.length; ++i) {

                if (i % 2 == 0) {
                    if (b[i] == 'r') continue;
                    if (oddRedId < oddRed.size()) {
                        while (oddRedId < oddRed.size() && (oddRed.get(oddRedId) < i)) ++oddRedId;
                        if (oddRedId < oddRed.size()) {
                            b[i] = 'r';
                            b[oddRed.get(oddRedId)] = 'b';
                            ++oddRedId;
                            ++retB;
                        } else {
                            ++retB;
                        }
                    } else {
                        ++retB;
                    }

                } else {

                    if (b[i] == 'b') continue;
                    if (evenBlackId < evenBlack.size()) {
                        while (evenBlackId < evenBlack.size() && (evenBlack.get(evenBlackId) < i)) ++evenBlackId;
                        if (evenBlackId < evenBlack.size()) {
                            b[i] = 'b';
                            b[evenBlack.get(evenBlackId)] = 'r';
                            ++evenBlackId;
                            ++retB;
                        } else ++retB;
                    } else ++retB;
                }
            }


            out.println(Math.min(retA, retB));

        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public String nextLine() {
            try {
                return reader.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return null;
        }

    }
}

