#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define st first
#define nd second
#define pii pair<int,int>
#define piii pair<int,pii>
#define sp " "
#define nl "\n"
#define all(x) x.begin(),x.end()
#define fastio() ios_base::sync_with_stdio(0);cin.tie(0);
#define ll long long
#define int ll
 
using namespace std;
 
const int N = 2e5+5;
const int INF = 1e9+5;
const int mod = 1e9+7;

int fac[11],cnto,cnts,ans;
string s;

void factorial(){
    fac[0]=1;
    for(int i=1;i<=10;i++)
        fac[i]=fac[i-1]*i;
}

int comb(int n,int r){
    return fac[n]/(fac[r]*fac[n-r]);
}

signed main(){
    #ifndef ONLINE_JUDGE
        freopen("in.txt","r",stdin);
        freopen("out.txt","w",stdout);
    #endif
    fastio()
    factorial();
    cin >> s;
    for(int i=0;i<10;i++){
        cnto+=(s[i]=='o');
        cnts+=(s[i]=='?');
    }
    if(cnto>4){
        cout << 0 << nl;
        return 0;
    }
    for(int i=0;i<=cnts;i++){
        if(cnto+i==0)
            continue;
        else if(cnto+i==1){
            ans+=comb(cnts,i);
        }
        else if(cnto+i==2){
            ans+=comb(cnts,i)*(2*4+6);
        }
        else if(cnto+i==3){
            ans+=comb(cnts,i)*3*12;
        }
        else if(cnto+i==4){
            ans+=comb(cnts,i)*24;
        }
        else
            break;
    }
    cout << ans << nl;
}
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

#ifndef _LOCAL
int main() {
    string s;
    cin >> s;
    ll ans = 0ll;
    vector<bool> must(10, false);
    vector<bool> must_not(10, false);
    for(int i = 0; i < 10; i++) {
        if(s[i] == 'o') {
            must[i] = true;
        } else if(s[i] == 'x') {
            must_not[i] = true;
        }
    }

    for(int a = 0; a < 10; a++) {
        for(int b = 0; b < 10; b++) {
            for(int c = 0; c < 10; c++) {
                for(int d = 0; d < 10; d++) {
                    vector<bool> p_must(10, false);
                    p_must[a] = p_must[b] = p_must[c] = p_must[d] = true;
                    bool ok = true;
                    for(int i = 0; i < 10; i++) {
                        if(must[i] && !p_must[i]) {
                            ok = false;
                        }
                        if(must_not[i] &&
                           (a == i || b == i || c == i || d == i)) {
                            ok = false;
                        }
                    }
                    if(ok) {
                        ans++;
                    }
                }
            }
        }
    }
    cout << ans << endl;
    return 0;
}
#endif