#include <bits/stdc++.h>
using namespace std;
string a, b;
int main() {
  int n;
  scanf("%d", &n);
  cin >> a;
  int t1 = 0, t2 = 0;
  int ans1 = 0, ans2 = 0;
  int b = 0, r = 0;
  for (int i = 0; i < n; ++i) {
    if (i % 2 == 0) {
      if (a[i] != 'r') {
        t1++;
        b++;
      }
    } else {
      if (a[i] != 'b') {
        t1++;
        r++;
      }
    }
    if (t1 >= 2 && b && r) {
      --b, --r;
      ans1++;
      t1 -= 2;
    }
  }
  ans1 += t1;
  b = 0, r = 0;
  for (int i = 0; i < n; ++i) {
    if (i % 2 == 0) {
      if (a[i] != 'b') {
        t2++;
        r++;
      }
    } else {
      if (a[i] != 'r') {
        t2++;
        b++;
      }
    }
    if (t2 >= 2 && b && r) {
      --b, --r;
      ans2++;
      t2 -= 2;
    }
  }
  ans2 += t2;
  printf("%d\n", min(ans1, ans2));
}
