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 xd[] = {0, 1, 0, -1};
int yd[] = {1, 0, -1, 0};
bool islucky(int x) {
  int four = 0, seven = 0;
  while (x) {
    if (x % 10 != 7 && x % 10 != 4) return false;
    if (x % 10 == 7)
      seven++;
    else
      four++;
    x = x / 10;
  }
  return four == seven;
}
bool is_prime(long long x) {
  if (x == 1) return false;
  for (int i = 2; i * i <= x; i++)
    if (x % i == 0) return false;
  return true;
}
int xx[] = {0, 1, 0, -1, 1, -1, 1, -1};
int yy[] = {1, 0, -1, 0, 1, 1, -1, -1};
int kx[] = {-2, -1, -2, -1, 1, 2, 2, 1};
int ky[] = {1, 2, -1, -2, -2, -1, 1, 2};
long long C(int k, int l) {
  if (l == k) return 1;
  if (l * 2 > k) l = k - l;
  long long res = 1, temp = l;
  for (int i = k - l + 1; i <= k; i++) {
    res *= i / temp;
    temp--;
  }
  return res;
}
long long sumOfDigit(int x) {
  int res = 0;
  while (x) {
    res += x % 10;
    x /= 10;
  }
  return res;
}
uint64_t bigPow(uint64_t base, uint64_t p) {
  uint64_t temp = 1;
  while (p--) {
    temp *= base;
  }
  return temp;
}
vector<int> soso;
bool prime[10000001] = {0};
void SieveOfEratosthenes(int n) {
  soso.push_back(2);
  for (int p = 3; p * p <= n; p += 2) {
    if (prime[p] == false) {
      for (int i = p * 2; i <= n; i += p) prime[i] = true;
    }
  }
  for (int i = 3; i <= n; i += 2)
    if (!prime[i]) soso.push_back(i);
}
int main() {
  string s;
  int ans = 0, n;
  cin >> n;
  cin >> s;
  for (int i = 1; i < s.length() - 1; i++) {
    if (s[i] == s[i - 1]) {
      if (s[i] == s[i + 1]) {
        s[i] = s[i] == 'r' ? 'b' : 'r';
        ans++;
      } else {
        char ch = s[i];
        s[i] = s[i + 1];
        s[i + 1] = ch;
        ans++;
      }
    }
  }
  cout << ans;
}
