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;
const long long mod = 1e9 + 7;
const long long N = 2e5 + 1;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  long long n, ans;
  string s;
  cin >> n >> s;
  long long btor = (s[0] == 'b'), rtob = 0;
  char lastch = 'r';
  for (int i = 1; i < n; i++) {
    if (s[i] == lastch) lastch == 'r' ? rtob++ : btor++;
    lastch = (lastch == 'r' ? 'b' : 'r');
  }
  ans = max(rtob, btor);
  btor = 0, rtob = (s[0] == 'r');
  lastch = 'b';
  for (int i = 1; i < n; i++) {
    if (s[i] == lastch) lastch == 'r' ? rtob++ : btor++;
    lastch = (lastch == 'r' ? 'b' : 'r');
  }
  ans = min(ans, max(btor, rtob));
  cout << ans;
}
