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;
using ll = long long;
using vi = vector<int>;
using pi = pair<int, int>;
const int mod = 1e9 + 7;
const ll inf = ll(1e18);
const int mxn = 2e3, mxa = 2e3;
int n;
string second;
void solve() {
  cin >> n >> second;
  string s1 = second;
  int r = 0, b = 0;
  for (int i = 1; i < n; ++i) {
    if (s1[i] == s1[i - 1]) {
      if (s1[i] == 'r')
        ++r;
      else
        ++b;
      s1[i] = s1[i] == 'r' ? 'b' : 'r';
    }
  }
  int ans = max(r, b);
  r = b = 0;
  if (second[0] == 'r') {
    ++r;
    second[0] = 'b';
  } else {
    ++b;
    second[0] = 'r';
  }
  for (int i = 1; i < n; ++i) {
    if (second[i] == second[i - 1]) {
      if (second[i] == 'r')
        ++r;
      else
        ++b;
      second[i] = second[i] == 'r' ? 'b' : 'r';
    }
  }
  cout << min(ans, max(r, b)) << '\n';
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int t;
  t = 1;
  while (t--) solve();
}
