#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int b = 0, r = 0, n, k, m, ans = 0;
  cin >> n;
  char a[n], rr[n], bb[n];
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    if (a[i] == 'b')
      ++b;
    else
      ++r;
    if (i % 2 == 0) {
      rr[i] = 'r';
      bb[i] = 'b';
    } else {
      rr[i] = 'b';
      bb[i] = 'r';
    }
  }
  int nr = 0, nb = 0, nr1 = 0, nb1 = 0;
  for (int i = 0; i < n; ++i) {
    if (a[i] != rr[i]) {
      if (a[i] == 'r')
        ++nr;
      else
        ++nb;
    }
    if (a[i] != bb[i]) {
      if (a[i] == 'r')
        ++nr1;
      else
        ++nb1;
    }
  }
  int ans1;
  ans = max(nr, nb);
  ans1 = max(nr1, nb1);
  cout << min(ans, ans1);
}
