#include <bits/stdc++.h>
using namespace std;
const int N=3e5+10;
typedef long long ll;
typedef unsigned long long ull;
const ll mod = 2000120420010122;
int n;
ll dp[5];
string s;
void solve()
{   
    int n = s.size();
    memset(dp,0,sizeof(dp));
    for(int i=0;i<n;i++)
    {
        if(s[i]=='c'||s[i]=='C')
        {
            dp[0]++;
            dp[0]%=mod;
            dp[3]+=dp[2];
            dp[3]%=mod;
        }
        else if(s[i]=='w'||s[i]=='W')
        {
            dp[1]+=dp[0];
            dp[1]%=mod;
        }
        else if(s[i]=='b'||s[i]=='B')
        {
            dp[2]+=dp[1];
            dp[2]%=mod;
        }
    }

    cout<<dp[3]<<'\n';


}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int t=1;
    // cin>>t;
    while(cin>>s)
    {
        solve();

    }


    return 0;
}

经典dp