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.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

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

    static class BAnatolyAndCockroaches {
        public void solve(int testNumber, inclass in, PrintWriter out) {
            int n = in.nextInt();
            String str = in.readLine();
            StringBuilder sb1 = new StringBuilder();
            StringBuilder sb2 = new StringBuilder();
            for (int i = 0; i < n; i++) {
                if (i % 2 == 0) {
                    sb1.append("r");
                    sb2.append("b");
                } else {
                    sb1.append("b");
                    sb2.append("r");
                }
            }
            String ans1 = sb1.toString();
            String ans2 = sb2.toString();
            int min_color_change = 0;
            int c1 = 0, c2 = 0;
            for (int i = 0; i < n; i++) {
                if (str.charAt(i) != ans1.charAt(i)) {
                    c1++;
                }
                if (str.charAt(i) != ans2.charAt(i)) {
                    c2++;
                }
            }
            min_color_change = Math.min(c1, c2);
            int[] arr1 = new int[2], arr2 = new int[2];
            for (int i = 0; i < n; i++) {
                if (str.charAt(i) != ans1.charAt(i)) {
                    arr1[str.charAt(i) == 'b' ? 0 : 1]++;
                    arr2[ans1.charAt(i) == 'b' ? 0 : 1]++;
                }
            }
            int x1 = Math.min(arr1[0], arr2[0]) / 2 + Math.min(arr1[0], arr2[0]) % 2 + Math.abs(arr1[0] - arr2[0]);
            arr1 = new int[2];
            arr2 = new int[2];
            for (int i = 0; i < n; i++) {
                if (str.charAt(i) != ans2.charAt(i)) {
                    arr1[str.charAt(i) == 'b' ? 0 : 1]++;
                    arr2[ans2.charAt(i) == 'b' ? 0 : 1]++;
                }
            }
            int x2 = Math.min(arr1[0], arr2[0]) / 2 + Math.min(arr1[0], arr2[0]) % 2 + Math.abs(arr1[0] - arr2[0]);
            out.println(Math.min(x1, Math.min(x2, min_color_change)));
        }

    }

    static class inclass {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private inclass.SpaceCharFilter filter;

        public inclass(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        private String readLine0() {
            StringBuilder buf = new StringBuilder();
            int c = read();
            while (c != '\n' && c != -1) {
                if (c != '\r') {
                    buf.appendCodePoint(c);
                }
                c = read();
            }
            return buf.toString();
        }

        public String readLine() {
            String s = readLine0();
            while (s.trim().length() == 0) {
                s = readLine0();
            }
            return s;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }
}

