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 l, u, v, w, x, y, z, a, b, c, d, e, f, t = 1, tc;
  long long flg, sz, cnt, gt, ans, mx, mn;
  long long m, k, n, i, j;
  long long low, hi, md, inp[200007], sm, ff;
  scanf("%lld", &n);
  string st, cp, age;
  cin >> st;
  cp += 'r';
  a = b = 0;
  for (int i = 0; i < n; i++) {
    if (st[i] == cp[i])
      ;
    else if (st[i] == 'r')
      a++;
    else
      b++;
    if (i % 2 == 0)
      cp += 'b';
    else
      cp += 'r';
  }
  x = max(a, b);
  cp = "b";
  a = b = 0;
  for (int i = 0; i < n; i++) {
    if (st[i] == cp[i])
      ;
    else if (st[i] == 'r')
      a++;
    else
      b++;
    if (i % 2)
      cp += 'b';
    else
      cp += 'r';
  }
  y = max(a, b);
  cout << min(x, y) << endl;
  return 0;
}
