#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
const int LEN = 1e5 + 5;
int i, j, k, n, m, s, t, ans, now;
char c[LEN], nowc;
int main() {
    scanf("%s", c + 1);
    n = strlen(c + 1);
    now = 1, nowc = c[1];
    for (int i = 2; i <= n; i++) {
        if (c[i] != c[i - 1]) {
            ans++;
        }
    }
    printf("%d\n", ans);
    return 0;
}