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() {
  long long int n, i, count = 0;
  cin >> n;
  string x, z;
  cin >> x;
  z = x;
  for (i = 0; i < n; i++) {
    if (x[i] == 'r')
      x[i] = '1';
    else
      x[i] = '0';
  }
  char y[n];
  for (i = 0; i < n; i++) {
    if (i % 2 == 0)
      y[i] = '1';
    else
      y[i] = '0';
  }
  i = 0;
  long long int count1 = 0, count2 = 0;
  while (i < n) {
    if (x[i] != y[i]) {
      if (x[i] == '1')
        count1++;
      else
        count2++;
      i++;
    } else
      i++;
  }
  count = max(count1, count2);
  count1 = 0, count2 = 0;
  x = z;
  for (i = 0; i < n; i++) {
    if (x[i] == 'r')
      x[i] = '1';
    else
      x[i] = '0';
  }
  for (i = 0; i < n; i++) {
    if (i % 2 == 0)
      y[i] = '0';
    else
      y[i] = '1';
  }
  i = 0;
  long long int r = 0;
  while (i < n) {
    if (x[i] != y[i]) {
      if (x[i] == '1')
        count1++;
      else
        count2++;
      i++;
    } else
      i++;
  }
  r = max(count1, count2);
  cout << min(count, r) << "\n";
  return 0;
}
