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>
int myabs(int a, int b) {
  int sum;
  if (a > b)
    sum = a - b;
  else
    sum = b - a;
  return sum;
}
char s[100005];
char ans[100005];
int flag1, flag2, flaga;
int an, bn;
int main() {
  int n;
  scanf("%d\n", &n);
  gets(s);
  if (s[0] == 'r') {
    ans[0] = 'r';
    for (int i = 1; i < n; i++) {
      if (i % 2 == 0)
        ans[i] = 'r';
      else
        ans[i] = 'b';
    }
    for (int i = 0; i < n; i++) {
      if (s[i] != ans[i])
        if (i % 2 == 0)
          flag1++;
        else
          flag2++;
    }
    an = flag1 > flag2 ? flag2 : flag1;
    bn = flag1 > flag2 ? flag1 : flag2;
    flaga = bn - an + an;
  }
  memset(ans, 0x00, sizeof(ans));
  flag1 = flag2 = 0;
  if (s[0] == 'b') {
    ans[0] = 'b';
    for (int i = 1; i < n; i++) {
      if (i % 2 == 0)
        ans[i] = 'b';
      else
        ans[i] = 'r';
    }
    for (int i = 0; i < n; i++) {
      if (s[i] != ans[i])
        if (i % 2 == 0)
          flag1++;
        else
          flag2++;
    }
    an = flag1 > flag2 ? flag2 : flag1;
    bn = flag1 > flag2 ? flag1 : flag2;
    flaga = bn - an + an;
  }
  printf("%d\n", flaga);
  return 0;
}
