#include <iostream>
using namespace std;
bool ok(string s){
int prev = s[0];
for(int i = 1; i < s.length(); i++){
if(s[i] == prev)
return false;
prev = s[i];
}
return true;
signed main() {
int ans = 0;
string s;
cin >> s;
for(int i = 1; i <= s.length(); i++){
for(int j = 0; j <= s.length()-i; j++)
if(ok(s.substr(j,i)))
ans++;
cout << ans;
#include <iostream>
using namespace std;
bool ok(string s){
int prev = s[0];
for(int i = 1; i < s.length(); i++){
if(s[i] == prev)
return false;
prev = s[i];
}
return true;
}
signed main() {
int ans = 0;
string s;
cin >> s;
for(int i = 1; i <= s.length(); i++){
for(int j = 0; j <= s.length()-i; j++)
if(ok(s.substr(j,i)))
ans++;
}
cout << ans;
}