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() {
  ios_base::sync_with_stdio(false);
  int n;
  char a[10005], copy[10005];
  cin >> n >> a;
  strcpy(copy, a);
  int ans = 0, alt = 0;
  for (int i = 0; i < n - 1; i++) {
    if (i % 2 == 0) {
      if (a[i] == 'r')
        continue;
      else {
        if (a[i + 1] == 'b') {
          a[i] = 'r';
        } else {
          a[i] = 'r';
          a[i + 1] = 'b';
        }
        ans++;
      }
    } else {
      if (a[i] == 'b')
        continue;
      else {
        if (a[i + 1] == 'r') {
          a[i] = 'b';
          ans++;
        } else {
          a[i] = 'b';
          a[i + 1] = 'r';
          ans++;
        }
      }
    }
  }
  if (a[n - 1] == a[n - 2]) {
    ans++;
  }
  strcpy(a, copy);
  for (int i = 0; i < n - 1; i++) {
    if (i % 2 == 0) {
      if (a[i] == 'b')
        continue;
      else {
        if (a[i + 1] == 'r') {
          a[i] = 'b';
        } else {
          a[i] = 'b';
          a[i + 1] = 'r';
        }
        alt++;
      }
    } else {
      if (a[i] == 'r')
        continue;
      else {
        if (a[i + 1] == 'b') {
          a[i] = 'r';
          alt++;
        } else {
          a[i] = 'r';
          a[i + 1] = 'b';
          alt++;
        }
      }
    }
  }
  if (a[n - 1] == a[n - 2]) alt++;
  if (ans > alt) ans = alt;
  cout << ans << endl;
  return 0;
}
