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;
char alt(char c) {
  if (c == 'r')
    return 'b';
  else
    return 'r';
}
int main() {
  ios_base::sync_with_stdio(false);
  long long n, t, i, j, k, m, ans = 0, an;
  string a, b, c;
  cin >> n;
  cin >> a;
  b = a;
  char cc = 'r';
  for (i = 0; i < a.size() - 1; i++) {
    if (a[i] != cc) {
      if (a[i + 1] == cc) {
        swap(a[i + 1], a[i]);
      } else
        a[i] = cc;
      ans += 1;
    }
    cc = alt(cc);
  }
  if (a[i] != cc) ans += 1;
  an = ans;
  ans = 0;
  cc = 'b';
  a = b;
  for (i = 0; i < a.size() - 1; i++) {
    if (a[i] != cc) {
      if (a[i + 1] == cc) {
        swap(a[i + 1], a[i]);
      } else
        a[i] = cc;
      ans += 1;
    }
    cc = alt(cc);
  }
  if (a[i] != cc) ans += 1;
  an = min(ans, an);
  cout << an << "\n";
  return 0;
}
