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.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) {

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

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

            int retA = 0;
            int retB = 0;

            for (int i = 0; i < a.length; ++i) {
                if ((i % 2 == 0)) {
                    // even => black
                    // even => red

                    if (a[i] != 'b') {
                        if (i + 1 < a.length && (a[i + 1] == 'b')) {
                            char temp = a[i];
                            a[i] = a[i + 1];
                            a[i + 1] = temp;
                            ++retA;
                        } else {
                            ++retA;
                        }
                    }

                    if (b[i] != 'r') {
                        if (i + 1 < b.length && (b[i + 1] == 'r')) {
                            char temp = b[i];
                            b[i] = b[i + 1];
                            b[i + 1] = temp;
                            ++retB;
                        } else {
                            ++retB;
                        }
                    }
                } else {

                    if (a[i] != 'r') {
                        if (i + 1 < a.length && (a[i + 1] == 'r')) {
                            char temp = a[i];
                            a[i] = a[i + 1];
                            a[i + 1] = temp;
                            ++retA;
                        } else {
                            ++retA;
                        }
                    }

                    if (b[i] != 'b') {
                        if (i + 1 < b.length && (b[i + 1] == 'b')) {
                            char temp = b[i];
                            b[i] = b[i + 1];
                            b[i + 1] = temp;
                            ++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;
        }

    }
}

