#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
using ll = long long;
const ll mod = 1000000007;
const double pi = 3.14159265358979;
const ll INF = 1e18;

int main() {
    string s; cin >> s;
    int a, b, c; a = b = c = 0;
    rep(i, 10) {
        if (s[i] == 'o') a++;
        else if (s[i] == '?') b++;
        else c++;
    }
    if (a > 4) {cout << 0 << endl; return 0;}
    if (a == 4) cout << 24 << endl;
    else if (a == 3) cout << 24 * b + 36 << endl;
    else if (a == 2) cout << 36 * b + (24 * b * (b - 1) / 2) + 14 << endl;
    else if (a == 1) cout << 14 * b + (36 * b * (b - 1) / 2) + (24 * b * (b - 1) * (b - 2) / 6) + 1 << endl;
    else if (a == 0) cout << b + (14 * b * (b - 1) / 2) + (36 * b * (b - 1) * (b - 2) / 6) + (24 * b * (b - 1) * (b - 2) * (b - 3) / 24) << endl;    return 0;
}
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;

string s;
long long n=10,a[11],b[11],c[5],ans,p;

int main(){
	long long i,j,u,v;
	cin>>s;
	for(i=0;i<n;i++){
		if(s[i]=='o') a[i]=1;
		if(s[i]=='x') a[i]=-1;
	}
	for(i=0;i<=9999;i++){
		u=i;
		memset(b,0,sizeof(b));
		c[1]=u%10;u/=10;b[c[1]]=1;
		c[2]=u%10;u/=10;b[c[2]]=1;
		c[3]=u%10;u/=10;b[c[3]]=1;
		c[4]=u%10;u/=10;b[c[4]]=1;
		p=0;
		for(j=0;j<n;j++){
			if(a[j]==1 && b[j]==0){
				p=1;
				break;
			}
			if(b[j]==1 && a[j]==-1){
				p=1;
				break;
			}
		}
		if(!p) ans++;
	}
	cout<<ans<<endl;
	return 0;
}