#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
const int INF = 1000000007;
const long double EPS = 1e-15;
const long double PI = acos(-1);
using namespace std;
using Graph = vector<vector<int>>;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long lcm(long long a, long long b) { return (a * b) / gcd(a, b); }
int solve() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int cnt = 0;
  for (int i = 0; i < (n - 1); ++i) {
    if (s[i] != s[i + 1]) cnt++;
  }
  cout << cnt << endl;
  return 0;
}
int main() {
  solve();
  return 0;
}
