#include <bits/stdc++.h>
using namespace std;
int main() {
  long long l, u, v, w, x, y, z, a, b, c, d, e, f, t = 1, tc;
  long long flg, sz, cnt, gt, ans, mx, mn;
  long long m, k, n, i, j;
  long long low, hi, md, inp[200007], sm, ff;
  scanf("%lld", &n);
  string st, cp, age;
  cin >> st;
  cp += 'r';
  a = b = 0;
  for (int i = 0; i < n; i++) {
    if (st[i] == cp[i])
      ;
    else if (st[i] == 'r')
      a++;
    else
      b++;
    if (i % 2 == 0)
      cp += 'b';
    else
      cp += 'r';
  }
  x = max(a, b);
  cp = "b";
  a = b = 0;
  for (int i = 0; i < n; i++) {
    if (st[i] == cp[i])
      ;
    else if (st[i] == 'r')
      a++;
    else
      b++;
    if (i % 2)
      cp += 'b';
    else
      cp += 'r';
  }
  y = max(a, b);
  cout << min(x, y) << endl;
  return 0;
}
