#include <bits/stdc++.h>
using namespace std;
inline int mod(int x) {
  if (x < 0) return -x;
  return x;
}
string x;
int n;
int a[100001], a_1[100001], pos1[100001], pos2[100001];
void showarray(int a[]) {
  for (int i = 1; i <= n; i++) cout << a[i] << " ";
  cout << endl;
}
int Convert(int p[], int q[]) {
  int sump = 0, sumq = 0;
  for (int i = 1; i <= n; i++) sump += p[i], sumq += q[i];
  int ans = mod(sumq - sump);
  for (int i = 1; i <= n; i++) {
    if (sump < sumq)
      if (p[i] == 0 && q[i] == 1) {
        p[i] = 1;
        sump++;
      }
    if (sump > sumq)
      if (p[i] == 1 && q[i] == 0) {
        p[i] = 0;
        sump--;
      }
  }
  for (int i = 1; i <= n; i++) {
    if (sump < sumq)
      if (p[i] == 0) p[i] = 1, sump++;
    if (sump > sumq)
      if (p[i] == 1) p[i] = 0, sump--;
  }
  int hdist = 0;
  for (int i = 1; i <= n; i++)
    if (p[i] != q[i]) hdist++;
  ans = ans + hdist / 2;
  return ans;
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> x;
  for (int i = 0; i < x.size(); i++) {
    a[i + 1] = (x[i] == 'r') ? 1 : 0;
    a_1[i + 1] = a[i + 1];
  }
  for (int i = 1; i <= n; i = i + 2) pos1[i] = 1, pos2[i] = 0;
  for (int i = 2; i <= n; i = i + 2) pos1[i] = 0, pos2[i] = 1;
  cout << min(Convert(a, pos1), Convert(a_1, pos2)) << endl;
  return 0;
}
