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;
  if (ss[0] == 'r') {
    for (i = 1; i < n; i++) {
      if (i % 2 != 0 && ss[i] != 'b') {
        st.push(ss[i]);
      } else if (i % 2 == 0 && ss[i] != 'r') {
        sp.push(ss[i]);
      }
    }
    long long int ans = 0;
    while (!st.empty() && !sp.empty()) {
      st.pop();
      sp.pop();
      ans++;
    }
    ans += st.size();
    ans += sp.size();
    cout << ans << endl;
  } else {
    for (i = 1; i < n; i++) {
      if (i % 2 != 0 && ss[i] != 'r') {
        st.push(ss[i]);
      } else if (i % 2 == 0 && ss[i] != 'b') {
        sp.push(ss[i]);
      }
    }
    long long int ans = 0;
    while (!st.empty() && !sp.empty()) {
      st.pop();
      sp.pop();
      ans++;
    }
    ans += st.size();
    ans += sp.size();
    cout << ans << endl;
  }
  return 0;
}
