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;
const long long N = 1e12 + 7;
const long long nol = 0;
long long n, cnt, ans;
string g;
bool a;
char b;
void vkoshp() {
  cin >> n >> g;
  for (long long i = 0; i < g.size(); i++) {
    if (i < g.size() - 2) {
      if (g[i] == g[i + 1] and g[i + 1] != g[i + 2])
        swap(g[i + 1], g[i + 2]), cnt++;
    }
  }
  if (n == 2) {
    if (g[0] == g[1]) cnt++;
    cout << cnt << endl;
    return;
  }
  a = false;
  b = g[0];
  for (long long i = 0; i < g.size(); i++) {
    if (a == false and b != g[i]) cnt++;
    if (a == true and b == g[i]) cnt++;
    if (a == false)
      a = true;
    else
      a = false;
  }
  cout << cnt << endl;
}
int main() {
  cout.tie(NULL);
  cin.tie(NULL);
  ios_base::sync_with_stdio(0);
  long long t = 1;
  while (t--) vkoshp();
}
