#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n - 1; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i <= n; i++)
#define FORR(i, m, n) for (int i = m; i >= n; i--)
#define SORT(v, n) sort(v, v + n)
using namespace std;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<ll, ll>;
using Graph = vector<vector<int>>;
using Edge = pair<int, ll>;
const ll INF = 1LL << 60;
const int MAX = 100000;
const int MOD = 1000000007;

int main()
{
    // cin高速化
    cin.tie(0);
    ios::sync_with_stdio(false);
    char c;
    int a = 0, b = 0;

    REP(i, 10)
    {
        cin >> c;
        if (c == 'o')
        {
            ++a;
        }
        else if (c == '?')
        {
            ++b;
        }
    }
    int ans = 0;
    // oが多すぎorxが多すぎ
    if (a > 4 || a + b == 0)
    {
        cout << ans << "\n";
        return 0;
    }
    if (a == 4)
        ans = 4 * 3 * 2;
    if (a == 3)
        ans = 3 * 2 * (b + 3) + 3 * 2 * (b + 2) + 3 * 2 * (b + 1) + 3 * 2 * b;
    if (a == 2)
        ans = 2 * (b + 2) * (b + 2) + 2 * (b + 1) * (b + 2) + 2 * (b + 1) * (b + 1) + 2 * b * (b + 2) + 2 * b * (b + 1) + 2 * b * b;
    if (a == 1)
        ans = (b + 1) * (b + 1) * (b + 1) + b * (b + 1) * (b + 1) + b * b * (b + 1) + b * b * b;
    if (a == 0)
        ans = b * b * b * b;
    cout << ans << "\n";
    return 0;
}
#include<bits/stdc++.h>
using namespace std;

char status[12];
int main(){
	scanf("%s",status);
	
	int ans=0;
	for(int num=0; num<=9999; num+=1){
		vector<bool> on(10);
		for(int x=num, t=0; t<4; t++,x/=10)
			on[x%10]=1;
		bool safe=true;
		for(int i=0; i<=9; i+=1)
			if((status[i]=='o' and on[i]==0) or (status[i]=='x' and on[i]))
				safe=false;
		ans+=safe;
	}
	printf("%d\n",ans);
}