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;
  cin >> n;
  char ch[n];
  for (int i = 0; i < n; i++) cin >> ch[i];
  int d;
  int r;
  int cnt1 = 0;
  int cnt2 = 0;
  if (ch[0] == 'r') {
    for (int i = 0; i < n; i++) {
      if (i % 2 != 0) {
        if (ch[i] == 'r') {
          cnt1++;
        }
      } else {
        if (ch[i] == 'b') {
          cnt2++;
        }
      }
    }
    if (cnt1 == cnt2) {
      d = (cnt1 + cnt2) / 2;
      cout << d;
    } else {
      if (cnt1 > cnt2) {
        d = cnt2;
        r = cnt1 - cnt2;
        d = d + r;
        cout << d;
      } else {
        d = cnt1;
        r = cnt2 - cnt1;
        d = d + r;
        cout << d;
      }
    }
  } else {
    for (int i = 0; i < n; i++) {
      if (i % 2 != 0) {
        if (ch[i] == 'b') cnt1++;
      } else {
        if (ch[i] == 'r') cnt2++;
      }
    }
    if (cnt1 == cnt2) {
      d = (cnt1 + cnt2) / 2;
      cout << d;
      return 0;
    }
    if (cnt1 > cnt2) {
      d = cnt2;
      r = cnt1 - cnt2;
      d = d + r;
      cout << d;
    } else {
      d = cnt1;
      r = cnt2 - cnt1;
      d = d + r;
      cout << d;
    }
  }
}
