bebd400c31f0e5a9bb0f48c71aa1062069f5b3c3db1a8a6e8a24a6326cbb4558
// 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;
}