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>
const long long mod = 1e9 + 7;
const int x = 1;
using namespace std;
long long qpow(long long a, long long b) {
  long long res = 1;
  while (b) {
    if (b & 1) res *= a, res %= mod;
    a *= a;
    a %= mod;
    b >>= 1;
  }
  return res;
}
long long isprime(long long n) {
  int i;
  if (n == 2) return 1;
  if (n % 2 == 0) return 0;
  for (i = 3; i <= sqrt(n); i += 2)
    if (n % i == 0) return 0;
  return 1;
}
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  char p[n];
  char p1[n];
  for (int i = 0; i < n; i++) {
    if (i % 2 == 0) {
      p[i] = 'r';
    } else {
      p[i] = 'b';
    }
  }
  for (int i = 1; i <= n; i++) {
    if (i % 2 != 0) {
      p1[i - 1] = 'b';
    } else {
      p1[i - 1] = 'r';
    }
  }
  int x = 0, x1 = 0;
  int y = 0, y1 = 0;
  for (int i = 0; i < n; i++) {
    if (p[i] != s[i] && s[i] == 'r') {
      x++;
    } else if (p[i] != s[i] && s[i] == 'b') {
      y++;
    } else if (p1[i] != s[i] && s[i] == 'r') {
      x1++;
    } else if (p1[i] != s[i] && s[i] == 'b') {
      y1++;
    }
  }
  int a = max(x, y);
  int b = max(x1, y1);
  cout << min(a, b);
  return 0;
}
