166
rbbbbbbbbbbbbrbrrbbrbbbrbbbbbbbbbbrbbbbbbrbbbrbbbbbrbbbbbbbrbbbbbbbrbbrbbbbbbbbrbbbbbbbbbbbbbbrrbbbrbbbbbbbbbbbbbbrbrbbbbbbbbbbbrbbbbbbbbbbbbbbrbbbbbbbbbbbbbbbbbbbbbb
 7
rrbrbrb
 1
r
 2
bb
 18
rrrrrrrrrrrrrrrrrb
 8
rbbrbrbr
 1
b
 13
rbbbrbrrbrrbb
 100
brbbbrrrbbrbrbbrbbrbbbbrbbrrbbbrrbbbbrbrbbbbbbbbbbbbbbbbrrrrbbbbrrrbbbbbbbrbrrbrbbbbrrrbbbbrbbrbbbrb
 2
rb
 2
rr
 2
br

70
 1
 0
 1
 8
 1
 0
 3
 34
 0
 1
 0

#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-9;
const long long INF = 1e17;
int getAns(const vector<bool> &now, const vector<bool> &pat) {
  int ans = 0, n = now.size();
  for (int i = 0; i < n; i++) {
    if (i + 1 == n) {
      ans += (now[i] != pat[i]);
      continue;
    }
    if (now[i] != pat[i]) {
      if (now[i + 1] != pat[i + 1]) {
        i++;
        ans++;
      } else {
        ans++;
      }
    }
  }
  return ans;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(nullptr);
  cout.tie(nullptr);
  int n;
  cin >> n;
  vector<bool> now(n);
  string s;
  cin >> s;
  for (int i = 0; i < n; i++) {
    now[i] = (s[i] == 'r');
  }
  vector<bool> pat(n);
  for (int i = 0; i < n; i++) {
    pat[i] = (i & 1);
  }
  int ans = getAns(now, pat);
  for (int i = 0; i < n; i++) {
    pat[i] = (pat[i] ^ 1);
  }
  ans = min(ans, getAns(now, pat));
  cout << ans << "\n";
  return 0;
}
