#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  char s[200000], s1[200000], s2[200000];
  int n, cr = 0, cb = 0, k1, k2, cr1 = 0, cb1 = 0;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> s[i];
  if (s[0] == 'r') {
    for (int i = 0; i < n; i++) {
      if (i % 2 == 0) {
        s1[i] = 'r';
        s2[i] = 'b';
      } else {
        s1[i] = 'b';
        s2[i] = 'r';
      }
    }
  } else {
    for (int i = 0; i < n; i++) {
      if (i % 2 == 0) {
        s1[i] = 'b';
        s2[i] = 'r';
      } else {
        s1[i] = 'r';
        s2[i] = 'b';
      }
    }
  }
  for (int i = 0; i < n; i++) {
    if (s[i] == 'r' && s1[i] == 'b') cr++;
    if (s[i] == 'r' && s2[i] == 'b') cr1++;
    if (s[i] == 'b' && s1[i] == 'r') cb++;
    if (s[i] == 'b' && s2[i] == 'r') cb1++;
  }
  if (cr >= cb)
    k1 = cb;
  else {
    k1 = cr;
  }
  if (cr1 >= cb1)
    k2 = cb1;
  else {
    k2 = cr1;
  }
  cout << min((k1 + abs(cr - cb)), k2 + abs(cr1 - cb1));
}
