#include using namespace std; int main(){ string s;cin>>s; int c = 0; for(; s[c] == 'c'; c++); cout << min(c-1,(int)s.size()-c) << endl; }