#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios::sync_with_stdio(false);
  int n;
  cin >> n;
  string str;
  cin >> str;
  char curr = 'r';
  string comparer;
  string comparer2;
  for (int i = 0; i != n; ++i) {
    comparer += curr;
    (curr == 'r') ? curr = 'b' : curr = 'r';
    comparer2 += curr;
  }
  unordered_map<string, int> count;
  for (int i = 0; i != n; ++i) {
    if (str[i] != comparer[i]) {
      string diff;
      diff += str[i];
      diff += comparer[i];
      count[diff]++;
    }
  }
  int ans = min(count["rb"], count["br"]) + abs(count["rb"] - count["br"]);
  count = unordered_map<string, int>();
  for (int i = 0; i != n; ++i) {
    if (str[i] != comparer2[i]) {
      string diff;
      diff += str[i];
      diff += comparer2[i];
      count[diff]++;
    }
  }
  ans =
      min(ans, min(count["rb"], count["br"]) + abs(count["rb"] - count["br"]));
  cout << ans << endl;
}
