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;
  cin >> n;
  string str;
  cin >> str;
  string blackStr = "", redStr = "";
  char black = 'b', red = 'r';
  for (int i = 0; i < n; i++) {
    if (i % 2 == 0) {
      blackStr = blackStr + black;
      redStr = redStr + red;
    } else {
      redStr = redStr + black;
      blackStr = blackStr + red;
    }
  }
  int cRed = 0, redOps = 0;
  for (int i = 0; i < n; i++) {
    if (str[i] != redStr[i]) {
      cRed++;
    }
  }
  if (cRed == 1) {
    cout << "1" << endl;
    return 0;
  } else {
    if (cRed % 2 == 0)
      redOps = cRed / 2;
    else
      redOps = cRed / 2 + 1;
  }
  int cBlk = 0, blkOps = 0;
  for (int i = 0; i < n; i++) {
    if (str[i] != blackStr[i]) {
      cBlk++;
    }
  }
  if (cBlk == 1) {
    cout << "1" << endl;
    return 0;
  } else {
    if (cBlk % 2 == 0)
      blkOps = cBlk / 2;
    else
      blkOps = cBlk / 2 + 1;
  }
  int total = min(cBlk, cRed);
  cout << total << endl;
  return 0;
}
