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 opat;
  cin >> opat;
  int count = 0;
  string pat = opat;
  char desired = 'r';
  set<int> wrongR;
  set<int> wrongB;
  for (long long int i = 0; i < pat.size(); i++) {
    if (pat[i] != desired) {
      if (desired == 'r') {
        wrongR.insert(i);
      } else {
        wrongB.insert(i);
      }
    }
    if (desired == 'r') {
      desired = 'b';
    } else {
      desired = 'r';
    }
  }
  count = min(wrongR.size(), wrongB.size());
  count += max(wrongR.size(), wrongB.size()) - count;
  int answer = count;
  desired = 'b';
  wrongR.clear();
  wrongB.clear();
  for (long long int i = 0; i < pat.size(); i++) {
    if (pat[i] != desired) {
      if (desired == 'r') {
        wrongR.insert(i);
      } else {
        wrongB.insert(i);
      }
    }
    if (desired == 'r') {
      desired = 'b';
    } else {
      desired = 'r';
    }
  }
  count = min(wrongR.size(), wrongB.size());
  count += max(wrongR.size(), wrongB.size()) - count;
  answer = min(answer, count);
  cout << answer;
}
