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