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 + 10;
const int inf = 2e9;
const int mod = 1e9 + 7;
const long long INF = 2e18;
int n, a[N], d[N], e[N], p[2];
string s;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> s;
  for (int i = 1; i <= n; ++i) {
    a[i] = (s[i - 1] == 'r' ? 1 : 0);
    ++p[a[i]];
    d[i] = e[i] = inf;
  }
  int b = p[0], r = p[1], curb = 0, curr = 0;
  for (int i = 1; i <= n; ++i) {
    if (i & 1) {
      if (!a[i]) {
        d[i] = min(d[i], d[i - 1]);
        --b;
      } else {
        if (!b) {
          d[i] = min(d[i], d[i - 1] + 1);
          --r;
        } else {
          d[i] = min(d[i], d[i - 1]);
          --b;
          if (curb)
            --curb;
          else
            ++curr, ++d[i];
        }
      }
    } else {
      if (a[i]) {
        d[i] = min(d[i], d[i - 1]);
        --r;
      } else {
        if (!r) {
          d[i] = min(d[i], d[i - 1] + 1);
          --b;
        } else {
          d[i] = min(d[i], d[i - 1]);
          --r;
          if (curr)
            --curr;
          else
            ++curb, ++d[i];
        }
      }
    }
  }
  b = p[0], r = p[1], curb = 0, curr = 0;
  for (int i = 1; i <= n; ++i) {
    if (!(i & 1)) {
      if (!a[i]) {
        e[i] = min(e[i], e[i - 1]);
        --b;
      } else {
        if (!b) {
          e[i] = min(e[i], e[i - 1] + 1);
          --r;
        } else {
          e[i] = min(e[i], e[i - 1]);
          --b;
          if (curb)
            --curb;
          else
            ++curr, ++e[i];
        }
      }
    } else {
      if (a[i]) {
        e[i] = min(e[i], e[i - 1]);
        --r;
      } else {
        if (!r) {
          e[i] = min(e[i], e[i - 1] + 1);
          --b;
        } else {
          e[i] = min(e[i], e[i - 1]);
          --r;
          if (curr)
            --curr;
          else
            ++curb, ++e[i];
        }
      }
    }
  }
  cout << min(d[n], e[n]);
  return 0;
}
