#include #include #include #include #include #include #include #include #include templateinline std::ostream& operator << (std::ostream& os, const std::pair& p) { return os << "(" << p.first << ", " << p.second << ")"; } templateinline std::ostream &operator<<(std::ostream &os, const std::vector& v) { bool first = true; os << "["; for (unsigned int i = 0; i < v.size(); i++) { if (!first)os << ", "; os << v[i]; first = false; }return os << "]"; } inline std::ostream &operator<<(std::ostream &os, const std::vector& v) { bool first = true; os << "["; for (unsigned int i = 0; i < v.size(); i++) { if (!first)os << ", "; os << "'" << v[i] << "'"; first = false; }return os << "]"; } templatevoid printarray(T a[], T2 sz, T2 beg = 0) { for (T2 i = beg; i < sz; ++i) std::cout << a[i] << " "; std::cout << std::endl; } using namespace std; int main() { string line; cin >> line; cout << min(line.find_last_of('c'), line.size() - line.find_first_of('w')) << endl; return 0; }