#include <bits/stdc++.h>
using namespace std;
map<string, int> dist;
map<string, bool> visited;
queue<string> q;
int main() {
  int n;
  string s, des1 = "", des2 = "";
  cin >> n >> s;
  for (int i = 0; i < n; i++) {
    if (i % 2 == 0) {
      des1 += "r";
      des2 += "b";
    } else {
      des1 += "b";
      des2 += "r";
    }
  }
  int wrongR1 = 0, wrongR2 = 0, wrongB1 = 0, wrongB2 = 0;
  for (int i = 0; i < n; i++) {
    if (i % 2 == 0) {
      if (s[i] == 'r') {
        wrongR2++;
      } else {
        wrongB1++;
      }
    } else {
      if (s[i] == 'r') {
        wrongR1++;
      } else {
        wrongB2++;
      }
    }
  }
  cout << min(min(wrongR1, wrongB1) + abs(wrongR1 - wrongB1),
              min(wrongR2, wrongB2) + abs(wrongR2 - wrongB2));
}
