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 int N = 1e5 + 5;
int n;
int main() {
  string s;
  cin >> n;
  cin >> s;
  string r, b;
  r = b = "";
  for (int i = 0; i < n; i++) {
    if (i % 2 == 0) {
      r += 'r';
      b += 'b';
    } else {
      r += 'b';
      b += 'r';
    }
  }
  int rr = 0, bb = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == 'r')
      rr++;
    else
      bb++;
  }
  string rs = s;
  int res = 0, resr = 0, resb = 0;
  int rrs = (n + 1) / 2;
  if (rrs > rr) {
    for (int i = 0; i < n; i++) {
      if (rs[i] == 'b' && r[i] == 'r') {
        rr++;
        rs[i] = 'r';
        resr++;
      }
      if (rr == rrs) break;
    }
  } else {
    for (int i = 0; i < n; i++) {
      if (rs[i] == 'r' && r[i] == 'b') {
        rr--;
        rs[i] = 'b';
        resr++;
      }
      if (rr == rrs) break;
    }
  }
  int tr = 0;
  for (int i = 0; i < n; i++) {
    if (rs[i] != r[i]) tr++;
  }
  resr += tr / 2;
  int bbs = (n + 1) / 2;
  string bs = s;
  if (bbs > bb) {
    for (int i = 0; i < n; i++) {
      if (bs[i] == 'r' && b[i] == 'b') {
        bb++;
        bs[i] = 'b';
        resb++;
      }
      if (bb == bbs) break;
    }
  } else {
    for (int i = 0; i < n; i++) {
      if (bs[i] == 'b' && b[i] == 'r') {
        bb--;
        bs[i] = 'r';
        resb++;
      }
      if (bb == bbs) break;
    }
  }
  int tb = 0;
  for (int i = 0; i < n; i++) {
    if (bs[i] != b[i]) tb++;
  }
  resb += tb / 2;
  res = min(resb, resr);
  cout << res << endl;
}
