#include <cstdio>
#include <algorithm>
#include <cmath>
using namespace std;
#include <cstring>
const int MAXN = 100005;
char s[MAXN]; int n;

int main() {
    scanf("%s", s + 1), n = strlen(s + 1);
    int ans = 0;
    for (int i = 1; i <= n; i++)
        if (s[i] != s[i - 1])
            ans++;
    printf("%d", ans - 1);
    return 0;
}
