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

#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const int MOD = 1e9 + 7;
int N;
char S[100005], SS[100005];
vector<int> r, b, rr, bb;
int main() {
  scanf("%d", &N);
  scanf("%s", &S);
  for (int i = N - 1; i >= 0; i--) {
    if (S[i] == 'r') r.push_back(i), rr.push_back(i);
    if (S[i] == 'b') b.push_back(i), bb.push_back(i);
    SS[i] = S[i];
  }
  int ans1 = 0, ans2 = 0;
  for (int i = 0; i < N; i++) {
    char c = (i % 2 == 0) ? 'r' : 'b';
    if (((int)(r).size()) > 0 && i >= r.back()) r.pop_back();
    if (((int)(b).size()) > 0 && i >= b.back()) b.pop_back();
    if (S[i] != c) {
      if (S[i] == 'r') {
        if (((int)(b).size()) > 0)
          swap(S[i], S[b.back()]), b.pop_back(), ans1++;
        else
          ans1++;
      } else {
        if (((int)(r).size()) > 0)
          swap(S[i], S[r.back()]), r.pop_back(), ans1++;
        else
          ans1++;
      }
    }
  }
  for (int i = 0; i < N; i++) {
    char c = (i % 2 == 0) ? 'b' : 'r';
    if (((int)(rr).size()) > 0 && i >= rr.back()) rr.pop_back();
    if (((int)(bb).size()) > 0 && i >= bb.back()) bb.pop_back();
    if (SS[i] != c) {
      if (SS[i] == 'r') {
        if (((int)(bb).size()) > 0)
          swap(SS[i], S[bb.back()]), bb.pop_back(), ans2++;
        else
          ans2++;
      } else {
        if (((int)(rr).size()) > 0)
          swap(SS[i], S[rr.back()]), rr.pop_back(), ans2++;
        else
          ans2++;
      }
    }
  }
  printf("%d\n", min(ans1, ans2));
  return 0;
}
