#include using namespace std; #define REP(i,n) for(int i=0;i ostream& operator<<(ostream& os,const vector& vec){ os << "["; for(const auto& v : vec){ os << v << ","; } os << "]"; return os; } typedef long long ll; typedef unsigned long long ull; typedef pair pii; typedef vector vi; typedef vector vvi; int main(){ string s;cin>>s; int n=s.size(); vector memo(n+1,0); for(int i=n-1;i>=0;i--){ if(s[i]=='w') memo[i] = memo[i+1]+1; else memo[i]=memo[i+1]; } ll ans=0; for(int i=0;i0); } cout << ans << endl; }