#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define int long long int
#define f(i,j,n) for(int i=j;i<=n;i++)
#define mod 1000000007
int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL),cout.tie(NULL);
    string s;   cin>>s;
    int ans=0;
    f(i,0,9)
    f(j,0,9)
    f(k,0,9)
    f(l,0,9){
        if(s[i]!='x'&& s[j]!='x' && s[k]!='x' && s[l]!='x') 
        {
            int x=1;
            f(a,0,9)
            if(a!=i && a!= j && a!= k && a!= l && s[a]=='o')
                x=0;
            ans+=x;
        }
    }
    cout<<ans;
}   
#include <bits/stdc++.h>
#define be(v) (v).begin(),(v).end()
#define pb(q) push_back(q)
#define rep(i, n) for(int i=0;i<n;i++)
#define all(i, v) for(auto& i : v)
typedef long long ll;
using namespace std;
const ll mod=1000000007, INF=(1LL<<60);
#define doublecout(a) cout<<fixed<<setprecision(10)<<a<<endl;

const ll N = 200007;
ll fac[N],finv[N],inv[N];
void cominit(){
    fac[0]=fac[1]=1;
    finv[0]=finv[1]=1;
    inv[1]=1;
    for(int i=2;i<N;i++){
        fac[i]=fac[i-1]*i%mod;
        inv[i]=mod-inv[mod%i]*(mod/i)%mod;
        finv[i]=finv[i-1]*inv[i]%mod;
    }
}
ll com(ll n,ll k){
    if(n<k)return 0;
    if(n<0 || k<0)return 0;
    return fac[n]*(finv[k]*finv[n-k]%mod)%mod;
}

int main() {
    cin.tie(0);
    cout.tie(0);
    ios::sync_with_stdio(false);
    string s;
    cin >> s;
    cominit();
    ll cnt = 0, cnt1 = 0;
    all(e, s) {
        if(e == 'o') cnt++;
        else if(e == '?') cnt1++;
    }
    ll ans = 0;
    rep(bit, 1 << cnt1) {
        int num = __builtin_popcount(bit);
        if(num + cnt >= 5) continue;
        if(num + cnt == 0) continue;
        num += cnt;
        if(num == 1) ans += 1;
        if(num == 2) ans += 14;
        if(num == 3) ans += 36;
        if(num == 4) ans += 24;
    }
    cout << ans << endl;
    return 0;
}


