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;
long long solve(string s, string res) {
  long long n = (long long)(s.size());
  long long a[n];
  for (long long i = 0; i < n; i++) {
    if (s[i] > res[i]) {
      a[i] = 1;
    } else if (s[i] == res[i]) {
      a[i] = 0;
    } else {
      a[i] = -1;
    }
  }
  long long cnt1 = count(a, a + n, 1), cnt2 = count(a, a + n, -1);
  return min(cnt1, cnt2) + abs(cnt1 - cnt2);
}
int main() {
  ios::sync_with_stdio(0);
  long long n;
  cin >> n;
  string s;
  cin >> s;
  string tmp1 = "", tmp2 = "";
  for (long long i = 0; i < n; i++) {
    if (i % 2) {
      tmp1 += "r", tmp2 += "b";
    } else {
      tmp1 += "b", tmp2 += "r";
    }
  }
  cout << min(solve(s, tmp1), solve(s, tmp2));
}
