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>
const int PI = acos(-1.0);
using namespace std;
const int Max = 10055;
int gcd(int a, int b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
long long lcm(long long a, long long b) { return (a * (b / gcd(a, b))); }
bool com(string x, string y) { return x + y < y + x; }
int main() {
  int n, red = 0, black = 0, sum = 0;
  string s;
  cin >> n >> s;
  bool ok = 0;
  if (s[0] == 'r') ok = 1;
  for (int i = 1; i < s.length(); i++) {
    if (ok == 1) {
      if (i % 2 == 0 && s[i] != 'r') {
        if (black > 0) {
          black--;
          sum++;
        } else
          red++;
      } else if (i % 2 != 0 && s[i] != 'b') {
        if (red > 0) {
          red--;
          sum++;
        } else
          black++;
      }
    } else {
      if (i % 2 == 0 && s[i] != 'b') {
        if (red > 0) {
          red--;
          sum++;
        } else
          black++;
      } else if (i % 2 != 0 && s[i] != 'r') {
        if (black > 0) {
          black--;
          sum++;
        } else
          red++;
      }
    }
  }
  cout << (red + black + sum);
  return 0;
}
