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() {
  int n;
  string s;
  cin >> n >> s;
  vector<int> zog, frd;
  for (int i = 0; i < (int)(n); ++i) {
    if (i % 2 == 0 && s[i] != 'r')
      zog.push_back(s[i]);
    else if (i % 2 != 0 && s[i] != 'b')
      frd.push_back(s[i]);
  }
  long long x1 = 0, x2 = 0;
  x1 = min(zog.size(), frd.size()) + max(zog.size(), frd.size()) -
       min(zog.size(), frd.size());
  zog.clear();
  frd.clear();
  for (int i = 0; i < n; i++) {
    if (i % 2 == 0 && s[i] != 'b')
      zog.push_back(s[i]);
    else if (i % 2 != 0 && s[i] != 'r')
      frd.push_back(s[i]);
  }
  x2 = min(zog.size(), frd.size()) + max(zog.size(), frd.size()) -
       min(zog.size(), frd.size());
  cout << min(x1, x2);
  return 0;
}
