#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cstdio>
#include <math.h>
#include <string>
#include <algorithm>
using namespace std;
int ans;
int n, k;
string s;
int main() {
cin >> n >> s;
while (k < n) {
for (int i = k;i < n;++i) {
if (i == n - 1) {
goto x;
}
if (s[i] == s[i + 1]) {
for (int j = i + 1;j < n;++j) {
if (j == n - 1) {
k = j;
}
if (s[j] == s[i]) {
ans++;
}
else {
k = j;
break;
}
}
break;
}
else {
k++;
break;
}
}
}
x:
cout << ans << endl;
//system("pause");
return 0;
}