#include<iostream>
#include<vector>
#include<set>
#include<map>
#include<algorithm>
#include<cmath>

using namespace std;

#define R (long long)(1e9 + 7)


string s;

bool valid(int a, int b, int c, int d) {
	return (s[a] != 'x' && s[b] != 'x' && s[c] != 'x' && s[d] != 'x');
}

int main() {
	cin >> s;
	set<int> definite;
	for(int i = 0; i < 10; i++) {
		if(s[i] == 'o')
			definite.insert(i);
	}
	set<vector<int>> ans;
	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++) {
					if(valid(a, b, c, d)) {
						set<int> temp = definite;
						temp.erase(a);
						temp.erase(b);
						temp.erase(c);
						temp.erase(d);
						if(temp.empty())
							ans.insert({a, b, c, d});
					}
				}
			}
		}
	}
	cout << ans.size() << '\n';
}
#include <bits/stdc++.h>
#define ll long long
#define pii pair<int,int>
#define vec vector
using namespace std;

int main() {
	ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	#ifdef LOCAL
//		freopen("in1.txt", "r", stdin);
//		freopen("in1.txt", "w", stdout);
	#endif
	string s;
	cin >> s;
	int a = 0, b = 0, c = 0;
	for (int i=0; i<s.size(); i++) {
		if (s[i] == 'o') a++;
		if (s[i] == 'x') b++;
		if (s[i] == '?') c++;
	}
	if (a > 4) {
		cout << 0 << '\n';
		return 0;
	}
	
	int res = 0;
	for (int p=0; p<10000; p++) {
		vec<bool> use(10);
		for (int x=p, i=0; i<4; i++, x/=10) {
			use[x%10] = 1;
		}
		bool poss = 1;
		for (int i=0; i<10; i++) {
			if (s[i] == 'o' && !use[i]) poss = 0;
			if (s[i] == 'x' && use[i]) poss = 0;
		}
		res += poss;
	}
	cout << res << '\n';
}