OIG XIV - zmi

// https://szkopul.edu.pl/problemset/problem/gfylBgxHvl-DByutdYjcr7dS/site/?key=statement
// OIJ XIV (2 etap, próbne)

#include <iostream>

int main() {
    std::ios_base::sync_with_stdio(0);
    std::cin.tie(0);
    std::cout.tie(0);

    std::string s;
    std::cin >> s;

    s += "?";

    int o = 0, g = 0;
    int ans = 0;

    while (g < s.size() - 1) {
        if (s[g + 1] == s[g]) {
            g++;
        } else {
            ans += g - o;
            o = ++g;
        }
    }

    std::cout << ans << '\n';

    return 0;
}