#include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; const ll INF=1LL<<60; typedef pair P; typedef pair PP; const ll MOD=1e9+7; int main(){ string S; cin>>S; int N=S.size(); vector num(N+1,0); for(int i=N-1;i>=0;i--){ num[i]=num[i+1]+(S[i]=='w'); } ll ans=0; for(int i=0;i