#include <bits/stdc++.h>
using namespace std;
const long long OO = 1e8;
const double EPS = (1e-7);
int dcmp(double x, double y) { return fabs(x - y) <= EPS ? 0 : x < y ? -1 : 1; }
class UnionFind {
 private:
  vector<int> p, rank;

 public:
  UnionFind(int N) {
    rank.assign(N, 0);
    p.assign(N, 0);
    for (size_t i = 0; i < N; i++) p[i] = i;
  }
  int findSet(int i) { return (p[i] == i) ? i : (p[i] = findSet(p[i])); }
  bool isSameSet(int i, int j) { return findSet(i) == findSet(j); }
  void unionSet(int i, int j) {
    if (!isSameSet(i, j)) {
      int x = findSet(i), y = findSet(j);
      if (rank[x] > rank[y])
        p[y] = x;
      else {
        p[x] = y;
        if (rank[x] == rank[y]) rank[y]++;
      }
    }
  }
};
int acm[100][100];
int n, m;
bool hasAdjiacent(int i, int j) {
  if (i == 0 && j == 0)
    return acm[i][j] == acm[i + 1][j] || acm[i][j] == acm[i][j + 1] ||
           acm[i][j] == acm[i + 1][j + 1];
  else if (i == 0 && j == m - 1)
    return acm[i][j] == acm[i + 1][j] || acm[i][j] == acm[i][j - 1] ||
           acm[i][j] == acm[i + 1][j - 1];
  else if (i == n - 1 && j == 0)
    return acm[i][j] == acm[i - 1][j] || acm[i][j] == acm[i][j + 1] ||
           acm[i][j] == acm[i - 1][j + 1];
  else if (i == n - 1 && j == m - 1)
    return acm[i][j] == acm[i - 1][j] || acm[i][j] == acm[i][j - 1] ||
           acm[i][j] == acm[i - 1][j - 1];
  else if (j == m - 1)
    return acm[i][j] == acm[i - 1][j] || acm[i][j] == acm[i][j - 1] ||
           acm[i][j] == acm[i - 1][j - 1] || acm[i][j] == acm[i + 1][j - 1] ||
           acm[i][j] == acm[i + 1][j];
  else if (i == 0)
    return acm[i][j] == acm[i][j + 1] || acm[i][j] == acm[i][j - 1] ||
           acm[i][j] == acm[i + 1][j - 1] || acm[i][j] == acm[i + 1][j] ||
           acm[i][j] == acm[i + 1][j + 1];
  else if (j == 0)
    return acm[i][j] == acm[i + 1][j] || acm[i][j] == acm[i - 1][j] ||
           acm[i][j] == acm[i - 1][j + 1] || acm[i][j] == acm[i][j + 1] ||
           acm[i][j] == acm[i + 1][j + 1];
  else if (i == n - 1)
    return acm[i][j] == acm[i][j - 1] || acm[i][j] == acm[i - 1][j - 1] ||
           acm[i][j] == acm[i - 1][j] || acm[i][j] == acm[i - 1][j + 1] ||
           acm[i][j] == acm[i][j + 1];
  else
    return acm[i][j] == acm[i - 1][j] || acm[i][j] == acm[i - 1][j + 1] ||
           acm[i][j] == acm[i][j + 1] || acm[i][j] == acm[i + 1][j + 1] ||
           acm[i][j] == acm[i + 1][j] || acm[i][j] == acm[i + 1][j - 1] ||
           acm[i][j] == acm[i][j - 1] || acm[i][j] == acm[i - 1][j - 1];
}
int main() {
  string s;
  int ss, rr;
  cin >> ss;
  rr = 0;
  cin >> s;
  for (size_t i = 0; i < ss; i++)
    if (i + 1 != ss)
      if (s[i] == s[i + 1]) rr++;
  cout << rr << endl;
  return 0;
}
