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;
long long MOD = 1e9 + 9;
const int OO = (int)1e9 + 7;
const long long OOO = (long long)1e13 + 7;
const int MAX = 109;
char c1, c2, c3;
string s, s1, s2, s3;
long long n, m, k, t, q, a, b, c, d, e, f, x, y, z, sol, sum = 0;
long long ar[100009 * 2];
long long dp[100009 * 2];
map<int, long long> mp;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> s;
  a = b = 0;
  s1 = s;
  for (int i = 0; i < n; i++) {
    if (i % 2 == 0)
      c1 = 'r';
    else
      c1 = 'b';
    if (i == n - 1 && s[i] != c1) a++;
    if (s[i] != c1) {
      if (c1 == s[i + 1]) swap(s[i], s[i + 1]);
      a++;
    }
  }
  s = s1;
  for (int i = 0; i < n; i++) {
    if (i % 2 == 0)
      c1 = 'b';
    else
      c1 = 'r';
    if (i == n - 1 && s[i] != c1)
      b++;
    else if (s[i] != c1) {
      if (c1 == s[i + 1]) swap(s[i], s[i + 1]);
      b++;
    }
  }
  cout << min(a, b) << endl;
  cout << "\n\n";
  return 0;
}
