//算法学习第四题,DP
#include <bits/stdc++.h>
using namespace std;
//using ll=long long;
const long long MOD = 2000120420010122;
//int 最大只有 $2 \times 10^9$,会爆,必须用 long long
void solve(){
string s;
while(cin >> s)
{
long long num_c{0};
long long num_cw{0};
long long num_cwb{0};
long long ans{0};
//ll dp0=0,dp1=0,dp2=0,ans=0;
for(char ch : s)
{
if(ch >= 'A' && ch <= 'Z') ch += 32;//转换大小写
if(ch == 'c')//可能是开头或结尾
{
ans = (ans + num_cwb) % MOD;
num_c = (num_c + 1) % MOD;
}
else if(ch == 'w')
{
num_cw = (num_cw + num_c) % MOD;
}
else if(ch == 'b')
{
num_cwb = (num_cwb + num_cw) % MOD;
}
}
cout << ans << "\n";
}
}
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
solve();
return 0;
}
// 64 位输出请用 printf("%lld")