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 int mod = 1e9 + 7;
const long long int inf = 1e18;
int main() {
  long long int n, r = 0, b = 0;
  cin >> n;
  string second;
  cin >> second;
  for (long long int i = (0); i < (n); i++) {
    if (second[i] == 'r') {
      r++;
    } else {
      b++;
    }
  }
  long long int ans = 0;
  if (n % 2) {
    long long int k1 = 0, k2 = 0;
    ans += (max(0ll, min(max(r, b) - n / 2, max(r, b) - (1 + n / 2))));
    for (long long int i = (0); i < (n); i++) {
      if (i % 2 && second[i] == 'r') {
        k1++;
      } else if (i % 2 == 0 && second[i] == 'b') {
        k1++;
      } else if (i % 2 == 0 && second[i] == 'r') {
        k2++;
      } else if (i % 2 && second[i] == 'b') {
        k2++;
      }
    }
    k1 = max(0ll, k1 - ans);
    k2 = max(0ll, k2 - ans);
    if (r > b) {
      cout << min(ans + (k1) / 2, ans + 1 + (k2) / 2);
      return 0;
    } else {
      cout << min(ans + (k1) / 2 + 1, ans + (k2) / 2);
      return 0;
    }
  } else {
    ans += max(r, b) - n / 2;
    long long int k1 = 0, k2 = 0;
    for (long long int i = (0); i < (n); i++) {
      if (i % 2 && second[i] == 'r') {
        k1++;
      } else if (i % 2 == 0 && second[i] == 'b') {
        k1++;
      } else if (i % 2 == 0 && second[i] == 'r') {
        k2++;
      } else if (i % 2 && second[i] == 'b') {
        k2++;
      }
    }
    k1 = max(0ll, k1 - ans);
    k2 = max(0ll, k2 - ans);
    cout << min(ans + (k1) / 2, ans + (k2) / 2);
  }
  return 0;
}
