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;
long long int MOD = 1000000007;
long long int inf = 1e15;
long long int powermod(long long int _a, long long int _b, long long int _m) {
  long long int _r = 1;
  while (_b) {
    if (_b % 2 == 1) _r = (_r * _a) % _m;
    _b /= 2;
    _a = (_a * _a) % _m;
  }
  return _r;
}
long long int string_to_number(string s) {
  long long int x = 0;
  stringstream convert(s);
  convert >> x;
  return x;
}
long long int add(long long int a, long long int b) {
  long long int x = (a + b) % MOD;
  return x;
}
long long int mul(long long int a, long long int b) {
  long long int x = (a * b) % MOD;
  return x;
}
long long int sub(long long int a, long long int b) {
  long long int x = (a - b + MOD) % MOD;
  return x;
}
long long int divi(long long int a, long long int b) {
  long long int x = a;
  long long int y = powermod(b, MOD - 2, MOD);
  long long int res = (x * y) % MOD;
  return res;
}
int main() {
  long int n;
  cin >> n;
  string s, temp;
  cin >> s;
  temp = s;
  long int count = 0;
  for (long int i = 1; i < n; i++) {
    if (s[i] != s[i - 1])
      continue;
    else {
      if (i == n - 1) {
        count++;
      } else {
        if (s[i] != s[i + 1]) {
          s[i] = s[i + 1];
          s[i + 1] = s[i - 1];
        } else
          s[i] = s[i] == 'b' ? 'r' : 'b';
        count++;
      }
    }
  }
  long int temp_count = count;
  count = 0;
  s = temp;
  for (long int i = n - 2; i >= 0; i--) {
    if (s[i] != s[i + 1])
      continue;
    else {
      if (i == 0) {
        count++;
      } else {
        if (s[i] != s[i - 1]) {
          s[i] = s[i - 1];
          s[i - 1] = s[i + 1];
        } else
          s[i] = s[i] == 'b' ? 'r' : 'b';
        count++;
      }
    }
  }
  long int ans = min(count, temp_count);
  cout << ans;
  return 0;
}
