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;
int HitungTranformasi(string kata, string testKata, int N, int ans) {
  int i;
  i = 2;
  while (i < N) {
    if (N % 2 == 1) {
      if (i < N - 1) {
        if ((kata[i] != testKata[0]) || (kata[i + 1] != testKata[1])) {
          ans++;
        }
      } else if (i == N - 1) {
        if (kata[i] != testKata[0]) {
          ans++;
        }
      }
    } else {
      if ((kata[i] != testKata[0]) || (kata[i + 1] != testKata[1])) {
        ans++;
      }
    }
    i += 2;
  }
  return (ans);
}
bool IsAllSama(string kata, int N) {
  bool found;
  int i;
  char c;
  c = kata[0];
  i = 1;
  found = true;
  while ((i < N) && (found)) {
    if (c == kata[i]) {
      i++;
    } else {
      found = false;
    }
  }
  return (found);
}
bool IsAlternate(string kata, int N) {
  bool found;
  char c;
  int i;
  found = true;
  c = kata[0];
  i = 1;
  while ((i < N) && (found)) {
    if (c != kata[i]) {
      c = kata[i];
      i++;
    } else {
      found = false;
    }
  }
  return (found);
}
int main() {
  ios_base::sync_with_stdio(false);
  int N, ans, hasil;
  string kata, testKata;
  cin >> N;
  cin >> kata;
  if (N == 1) {
    cout << 0 << endl;
  } else if (N == 2) {
    if (kata[0] != kata[1]) {
      cout << 0 << endl;
    } else {
      cout << 1 << endl;
    }
  } else {
    if (IsAlternate(kata, N)) {
      cout << 0 << endl;
    } else {
      if (IsAllSama(kata, N)) {
        cout << N / 2 << endl;
      } else {
        testKata = "";
        if (kata[0] != kata[1]) {
          testKata += kata[0];
          testKata += kata[1];
          ans = 0;
          hasil = HitungTranformasi(kata, testKata, N, ans);
          cout << hasil << endl;
        } else {
          testKata = "";
          if (kata[0] == 'r') {
            kata[0] = 'b';
            kata[1] = 'r';
            testKata += kata[0];
            testKata += kata[1];
            ans = 1;
            hasil = HitungTranformasi(kata, testKata, N, ans);
            testKata = "";
            kata[0] = 'r';
            kata[1] = 'b';
            ans = 1;
            testKata += kata[0];
            testKata += kata[1];
            hasil = min(HitungTranformasi(kata, testKata, N, ans), hasil);
          } else {
            kata[0] = 'r';
            kata[1] = 'b';
            testKata += kata[0];
            testKata += kata[1];
            ans = 1;
            hasil = HitungTranformasi(kata, testKata, N, ans);
            testKata = "";
            kata[0] = 'b';
            kata[1] = 'r';
            ans = 1;
            testKata += kata[0];
            testKata += kata[1];
            hasil = min(HitungTranformasi(kata, testKata, N, ans), hasil);
          }
          cout << hasil << endl;
        }
      }
    }
  }
  return 0;
}
