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;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
template <class T>
T max(T a, T b, T c) {
  return ((a > b) ? ((a > c) ? a : c) : ((b > c) ? b : c));
}
template <class T>
T min(T a, T b, T c) {
  return ((a < b) ? ((a < c) ? a : c) : ((b < c) ? b : c));
}
const int MOD = (1e9) + 7;
const int MAXN = (1e5) + 9;
int T = 1, N = 1;
int main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(NULL);
  while (T--) {
    int n;
    cin >> n;
    string str;
    cin >> str;
    int a = 0, b = 0;
    for (int i = 0; i < n; i++) {
      if (i % 2 == 0 && str[i] == 'b') {
        if (i != n - 1 && str[i + 1] == 'r') {
          a++;
          i++;
        } else {
          a++;
        }
      } else if (i % 2 == 1 && str[i] == 'r') {
        if (i != n - 1 && str[i + 1] == 'b') {
          a++;
          i++;
        } else {
          a++;
        }
      }
    }
    for (int i = 0; i < n; i++) {
      if (i % 2 == 0 && str[i] == 'r') {
        if (i != n - 1 && str[i + 1] == 'b') {
          b++;
          i++;
        } else {
          b++;
        }
      } else if (i % 2 == 1 && str[i] == 'b') {
        if (i != n - 1 && str[i + 1] == 'r') {
          b++;
          i++;
        } else {
          b++;
        }
      }
    }
    cout << min(a, b) << "\n";
  }
  return 0;
}
