#include <bits/stdc++.h>
using namespace std;
const int inf = 2e9;
const int maxn = 1e6 + 10;
int d[4][2] = {1, 0, -1, 0, 0, 1, 0, -1};
inline long long read() {
  long long s = 0, w = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') w = -1;
    ch = getchar();
  }
  while (isdigit(ch)) s = s * 10 + ch - '0', ch = getchar();
  return s * w;
}
inline void write(long long x) {
  if (x < 0) putchar('-'), x = -x;
  if (x > 9) write(x / 10);
  putchar(x % 10 + '0');
}
char s[maxn];
int main() {
  int n, ans = 0;
  cin >> s + 1;
  n = strlen(s + 1);
  for (int i = 1; i <= n; i++) {
    int cnt = 0;
    for (int j = i; j <= n + 1; j++) {
      if (s[i] == s[j])
        cnt++;
      else {
        i = j;
        ans += cnt;
        break;
      }
    }
  }
  cout << ans << endl;
  return 0;
}
