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 i = 0, j = 1, count = 0;
  long long n;
  char swap;
  cin >> n;
  string s;
  cin >> s;
  int resRB = 0, resBR = 0, r = 0, b = 0;
  string temp = "";
  for (int i = 0; i < n / 2; i++) {
    temp += "br";
  }
  if (n % 2 == 1) temp += "b";
  for (int i = 0; i < n; i++) {
    if (s[i] != temp[i]) {
      if (temp[i] == 'r')
        r++;
      else
        b++;
    }
  }
  resBR = max(r, b);
  r = 0;
  b = 0;
  temp.clear();
  for (int i = 0; i < n / 2; i++) {
    temp += "rb";
  }
  if (n % 2 == 0) temp += "r";
  for (int i = 0; i < n / 2; i++) {
    if (s[i] != temp[i]) {
      if (temp[i] == 'b')
        b++;
      else
        r++;
    }
  }
  resRB = max(r, b);
  cout << min(resRB, resBR) << endl;
  return 0;
}
