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 N = 1e5 + 5;
int x[N], t[N];
int main() {
  int i, j, n;
  string s;
  cin >> n >> s;
  for (i = 0; i < n; ++i)
    if (s[i] == 'r')
      x[i] = 1;
    else
      x[i] = 0;
  int p = 0, ret = 1e9, cur = 0;
  for (i = 0; i < n; ++i) t[i] = p, p ^= 1;
  p = 1;
  for (i = 0, j = 0; i < n; ++i) {
    if (x[i] != t[i]) {
      for (j = max(j, i + 1); j < n; ++j)
        if (x[j] == t[i] && x[j] != t[j]) {
          swap(x[j], x[i]), ++j;
          ++cur;
          break;
        }
      if (x[i] != t[i]) ++cur;
    }
  }
  ret = cur;
  for (i = 0; i < n; ++i)
    if (s[i] == 'r')
      x[i] = 1;
    else
      x[i] = 0;
  for (i = 0; i < n; ++i) t[i] = p, p ^= 1;
  cur = 0;
  for (i = 0, j = 0; i < n; ++i) {
    if (x[i] != t[i]) {
      for (j = max(j, i + 1); j < n; ++j)
        if (x[j] == t[i] && x[j] != t[j]) {
          swap(x[j], x[i]);
          ++j;
          ++cur;
          break;
        }
      if (x[i] != t[i]) ++cur;
    }
  }
  ret = min(ret, cur);
  cout << ret << endl;
}
