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 vl = vector<long long>;
using pii = pair<int, int>;
const int DX[9] = {0, 1, 0, -1, 1, 1, -1, -1, 0},
          DY[9] = {-1, 0, 1, 0, -1, 1, 1, -1, 0};
const int INF = 1e9;
const long long INFLL = 1e18;
template <class T, class U>
ostream &operator<<(ostream &os, const pair<T, U> &p) {
  os << "(" << p.first << " " << p.second << ")";
  return os;
}
template <class T>
ostream &operator<<(ostream &os, const vector<T> &v) {
  for (auto i = begin(v); i != end(v); i++)
    os << *i << (i == end(v) - 1 ? "" : " ");
  return os;
}
signed main() {
  int n;
  string s;
  cin >> n >> s;
  vector<bool> a(n, false), b(n, false);
  for (int i = 0; i < (int)(n); i++) {
    if (i % 2 == 0) {
      if (s[i] == 'b') a[i] = true;
      if (s[i] == 'r') b[i] = true;
    } else {
      if (s[i] == 'r') a[i] = true;
      if (s[i] == 'b') b[i] = true;
    }
  }
  ll ans1 = 0, ans2 = 0;
  for (int i = 1; i < (int)(n); i++) {
    if (a[i - 1] && a[i]) {
      ans1++;
      a[i - 1] = false;
      a[i] = false;
    } else if (i == n - 1 && a[i - 1] == false && a[i]) {
      ans1++;
      a[i] = false;
    } else if (a[i - 1] == false && a[i] && a[i + 1] == false) {
      ans1++;
      a[i] = false;
    }
  }
  for (int i = 1; i < (int)(n); i++) {
    if (b[i - 1] && b[i]) {
      ans2++;
      b[i - 1] = false;
      b[i] = false;
    } else if (i == n - 1 && b[i - 1] == false && b[i]) {
      ans2++;
      b[i] = false;
    } else if (b[i - 1] == false && b[i] && b[i + 1] == false) {
      ans2++;
      b[i] = false;
    }
  }
  cout << min(ans1, ans2) << endl;
  return 0;
}
