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;
int main() {
  long long int a, b, c, d, e, f, g, h, i, j, k, m, n, o, p, q, r, s, t, u, v,
      w, x, y, z, l;
  long long int tc;
  cin >> n;
  string ss;
  cin >> ss;
  stack<char> st, sp, sl, sd;
  string rr = "", rt = "";
  for (i = 0; i < n; i++) {
    if (i % 2 == 0)
      rr += 'b';
    else
      rr += 'r';
    if (i % 2 == 0)
      rt += 'r';
    else
      rt += 'b';
  }
  for (i = 0; i < n; i++) {
    if (ss[i] != rr[i] && ss[i] == 'r') {
      st.push(ss[i]);
    } else if (ss[i] != rr[i] && ss[i] == 'b') {
      sp.push(ss[i]);
    }
    if (ss[i] != rt[i] && ss[i] == 'b') {
      sl.push(ss[i]);
    } else if (ss[i] != rt[i] && ss[i] == 'r') {
      sd.push(ss[i]);
    }
  }
  long long int ans = 0, ans2 = 0;
  while (!st.empty() && !sp.empty()) {
    ans++;
    st.pop();
    sp.pop();
  }
  ans += st.size();
  ans += sp.size();
  while (!sl.empty() && !sd.empty()) {
    ans2++;
    sl.pop();
    sd.pop();
  }
  ans2 += sl.size();
  ans2 += sd.size();
  c = min(ans, ans2);
  cout << c << endl;
  return 0;
}
