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;
int main() {
  int n, minn = 1e9, t1 = 0, t2 = 0;
  char s[100005];
  scanf("%d", &n);
  scanf("%s", s);
  for (int i = 0; i < n; i++) {
    if (i % 2 == 0) {
      if (s[i] == 'r')
        continue;
      else {
        if (i + 1 < n && s[i + 1] == 'r') {
          t1++;
          int t;
          t = s[i];
          s[i] = s[i + 1];
          s[i + 1] = t;
        } else {
          t1++;
        }
      }
    } else {
      if (s[i] == 'b')
        continue;
      else {
        if (i + 1 < n && s[i + 1] == 'b') {
          t1++;
          int t;
          t = s[i];
          s[i] = s[i + 1];
          s[i + 1] = t;
        } else {
          t1++;
        }
      }
    }
  }
  for (int i = 0; i < n; i++) {
    if (i % 2 == 0) {
      if (s[i] == 'b')
        continue;
      else {
        if (i + 1 < n && s[i + 1] == 'b') {
          t2++;
          int t;
          t = s[i];
          s[i] = s[i + 1];
          s[i + 1] = t;
        } else {
          t2++;
        }
      }
    } else {
      if (s[i] == 'r')
        continue;
      else {
        if (i + 1 < n && s[i + 1] == 'r') {
          t2++;
          int t;
          t = s[i];
          s[i] = s[i + 1];
          s[i + 1] = t;
        } else {
          t2++;
        }
      }
    }
  }
  minn = min(t1, t2);
  printf("%d\n", minn);
  return 0;
}
