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 INF = 1e18;
const int mod = 1e9 + 7;
const int N = 1e5 + 10;
int n;
int func1(string s) {
  int ans = 0;
  for (int i = 0; i <= n - 1; ++i) {
    if (i & 1 && s[i] == 'r') {
      if (i + 1 < n && s[i + 1] == 'b') {
        ans++;
        swap(s[i], s[i + 1]);
      } else {
        ans++;
        s[i] == 'b';
      }
    }
    if (!(i & 1) && s[i] == 'b') {
      if (i + 1 < n && s[i + 1] == 'r') {
        ans++;
        swap(s[i], s[i + 1]);
      } else {
        ans++;
        s[i] == 'r';
      }
    }
  }
  return ans;
}
int func2(string s) {
  int ans = 0;
  for (int i = 0; i <= n - 1; ++i) {
    if (!(i & 1) && s[i] == 'r') {
      if (i + 1 < n && s[i + 1] == 'b') {
        ans++;
        swap(s[i], s[i + 1]);
      } else {
        ans++;
        s[i] == 'b';
      }
    }
    if ((i & 1) && s[i] == 'b') {
      if (i + 1 < n && s[i + 1] == 'r') {
        ans++;
        swap(s[i], s[i + 1]);
      } else {
        ans++;
        s[i] == 'r';
      }
    }
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  string s;
  cin >> n;
  cin >> s;
  cout << min(func1(s), func2(s));
  return 0;
}
