#include<bits/stdc++.h>

typedef int64_t ll;
using namespace std;
const int INF = 1000000007;
int fact(int n);
 
int nCr(int n, int r)
{
    return fact(n) / (fact(r) * fact(n - r));
}
 
int fact(int n)
{
    int res = 1;
    for (int i = 2; i <= n; i++)
        res = res * i;
    return res;
}

int main(){
    #ifndef ONLINE_JUDGE
        freopen("input.txt","r",stdin);
        freopen("out.txt","w",stdout);
    #endif
    string s;
    cin>>s;
    ll count1=0,count2=0;
    for(ll i=0;i<s.size();i++){
        if(s[i]=='o'){
            count1++;
        }
        else if(s[i]=='?'){
            count2++;
        }
    }
    if(count1>4){
        cout<<0<<endl;
        return 0;
    }
    ll n = count1,m=count2,ans=0;
    for(ll r=0;r<=n;r++){
        ans = ans + nCr(n,r) * pow(-1,r) * pow((n+m-r),4);
    }
    cout<<ans<<endl;

}
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define int long long
signed main(){
    int x=0;
    int o = 0;
    int q =0;
    int ans=0;
    rep(i, 10){
        char s;
        cin >> s;
        if (s=='o') o++;
        else if (s=='x') x++;
        else q++;
    }
    if (o+q>0){ //数字一つ
        if (o==1) ans+=1;
        else if (o==0) ans += q;
        //cout << q << endl;
    }
    if (o+q>1) {
        if (o==2) ans += 14;
        else if (o==1) ans += q*14;
        else if (o==0) ans += q*(q-1)/2*14;
        //cout << q*(q-1)/2*14 << endl;
    }
    if (o+q>2){
        if (o==3) ans += 36;
        else if (o==2) ans += q*36;
        else if (o==1) ans += q*(q-1)/2*36;
        else if (o==0) ans += q*(q-1)*(q-2)/6*36;
        //cout << q*(q-1)*(q-2)/6*36 << endl;
    }
    if (o+q>3){
        if (o==4) ans += 24;
        else if (o==3) ans += q*24;
        else if (o==2) ans += q*(q-1)/2*24;
        else if (o==1) ans += q*(q-1)*(q-2)/6*24;
        else if (o==0) ans += q*(q-1)*(q-2)*(q-3)/24*24;
        //cout << q*(q-1)*(q-2)*(q-3)/24*24 << endl;
    }
    cout << ans << endl;
}