#include <bits/stdc++.h>
using namespace std;
int n;
int x[2], y[2];
char s[1234567];
int main() {
  ios::sync_with_stdio(0);
  scanf(" %d %s", &n, s);
  for (int i = 0; i < n; i++) {
    if (s[i] == 'r')
      x[i & 1]++;
    else
      y[i & 1]++;
  }
  cout << min(max(x[0], y[1]), max(x[1], y[0]));
  return 0;
}
