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;
inline int getint() {
  int res = 0, fh = 1;
  char ch = getchar();
  while ((ch < '0' || ch > '9') && ch != '-') ch = getchar();
  if (ch == '-') fh = -1, ch = getchar();
  while (ch <= '9' && ch >= '0') res = res * 10 + ch - '0', ch = getchar();
  return res * fh;
}
inline long long getll() {
  long long res = 0, fh = 1;
  char ch = getchar();
  while ((ch < '0' || ch > '9') && ch != '-') ch = getchar();
  if (ch == '-') fh = -1, ch = getchar();
  while (ch <= '9' && ch >= '0') res = res * 10 + ch - '0', ch = getchar();
  return res * fh;
}
int getc() {
  char ch = getchar();
  while (ch != 'b' && ch != 'r') ch = getchar();
  if (ch == 'b')
    return 1;
  else
    return 0;
}
int n;
int a[100001];
int ans;
int main() {
  n = getint();
  for (int i = 1; i <= n; i++) a[i] = getc();
  for (int i = 2; i <= n; i++) {
    if (a[i] != a[i - 1])
      continue;
    else {
      int pre = ans;
      for (int j = i + 1; j <= n; j++)
        if (a[j] == a[j + 1] && a[i] != a[j]) {
          swap(a[i], a[j]);
          ans++;
          break;
        }
      if (pre == ans) {
        ans++;
        a[i] = 1 - a[i];
      }
    }
  }
  printf("%d", ans);
  return 0;
}
