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 N = 100005;
char num[N];
int ans[N];
int main() {
  int n, m;
  scanf("%d", &n);
  scanf("%s", (num + 1));
  ans[0] = 0;
  for (int i = 1; i <= n; i++) {
    ans[i] = N;
    if (i & 1) {
      if (num[i] != 'r') {
        ans[i] = min(ans[i - 1] + 1, ans[i]);
        if (num[i - 1] == 'r' && i != 1) ans[i] = min(ans[i - 2] + 1, ans[i]);
      } else {
        ans[i] = min(ans[i - 1], ans[i]);
      }
    } else {
      if (num[i] != 'b') {
        ans[i] = min(ans[i - 1] + 1, ans[i]);
        if (num[i - 1] == 'b' && i != 1) ans[i] = min(ans[i - 2] + 1, ans[i]);
      } else {
        ans[i] = min(ans[i - 1], ans[i]);
      }
    }
  }
  int all = ans[n];
  for (int i = 1; i <= n; i++) {
    ans[i] = N;
    if (i & 1) {
      if (num[i] != 'b') {
        ans[i] = min(ans[i - 1] + 1, ans[i]);
        if (num[i - 1] == 'b' && i != 1) ans[i] = min(ans[i - 2] + 1, ans[i]);
      } else {
        ans[i] = min(ans[i - 1], ans[i]);
      }
    } else {
      if (num[i] != 'r') {
        ans[i] = min(ans[i - 1] + 1, ans[i]);
        if (num[i - 1] == 'r' && i != 1) ans[i] = min(ans[i - 2] + 1, ans[i]);
      } else {
        ans[i] = min(ans[i - 1], ans[i]);
      }
    }
  }
  cout << min(all, ans[n]) << endl;
  return 0;
}
