#include<string>
#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
using namespace std;

enum {
	A_one = 4,
	A_two = 12,
	A_three = 24,
	A_four = 24
};

int main(){
	string input;
	cin >> input;
	int len = input.size();
	int exist = 0;
	int notSure = 0;
	int notExist = 0;
	int res = 0;
	if (len != 10) {
		cout << res;
		return 0;
	}
	for (int i = 0; i < len; i++) {
		if (input[i] == 'o') exist++;
		else if (input[i] == '?') notSure++;
		else notExist++;
	}
	if (exist > 4) {
		cout << res;
		return 0;
	}
	else if (exist == 4) {
		res = A_four;
		cout << res;
		return 0;
	}
	else if (exist == 3) {
		if (notSure < 1) {
			res = 3 * A_two;
			cout << res;
			return 0;
		}
		else {
			res = 3 * A_two + notSure * A_three;
			cout << res;
			return 0;
		}
	}
	else if (exist == 2) {
		if (notSure == 0) {
			res = 14;
			cout << res;
			return 0;
		}
		else if (notSure == 1) {
			res = 14 + 3 * A_two;
			cout << res;
			return 0;
		}
		else {
			res = 14 + notSure * 3 * A_two + notSure * (notSure - 1) / 2 * A_three;
			cout << res;
			return 0;
		}
	}
	else if (exist == 1) {
		if (notSure == 0) {
			res = 1;
			cout << res;
			return 0;
		}
		else if (notSure == 1) {
			res = 1 + 14;
			cout << res;
			return 0;
		}
		else if (notSure == 2) {
			res = 1 + 2 * 14 + 3 * A_two;
			cout << res;
			return 0;
		}
		else {
			res = 1 + notSure * 14 + notSure * (notSure - 1) / 2 * 3 * A_two + notSure * (notSure - 1) * (notSure - 2) / 6 * A_three;
			cout << res;
			return 0;
		}
	}
	//exist == 0;
	else {
		if (notSure == 0) {
			cout << res;
			return 0;
		}
		else if (notSure == 1) {
			res = 1;
			cout << res;
			return 0;
		}
		else if (notSure == 2) {
			res = 2 + 14;
			cout << res;
			return 0;
		}
		else if (notSure == 3) {
			res = 3 + 3 * 14 + 3 * A_two;
			cout << res;
			return 0;
		}
		else {
			res = notSure + notSure * (notSure - 1) / 2 * 14 + notSure * (notSure - 1) * (notSure - 2) / 6 * 3 * A_two + notSure * (notSure - 1) * (notSure - 2) * (notSure - 3) / 24 * A_four;
			cout << res;
			return 0;
		}
	}
}
#include<bits/stdc++.h>
#define int long long
#define endl '\n'
using namespace std;

int32_t main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	string s;
	cin >> s;
	set<int> avail, not_avail, unsure;
	for (int i = 0; i < 10; i++) {
		if (s[i] == 'o') avail.insert(i);
		else if (s[i] == 'x') not_avail.insert(i);
		else unsure.insert(i);
	}

	int ans = 0;
	for (int i = 0; i < 10; i++) {
		if (not_avail.count(i)) continue;
		for (int j = 0; j < 10; j++) {
			if (not_avail.count(j)) continue;
			for (int k = 0; k < 10; k++) {
				if (not_avail.count(k)) continue;
				for (int l = 0; l < 10; l++) {
					if (not_avail.count(l)) continue;
					set<int> temp;
					if (avail.count(i)) temp.insert(i);
					if (avail.count(j)) temp.insert(j);
					if (avail.count(k)) temp.insert(k);
					if (avail.count(l)) temp.insert(l);
					if (temp.size() == avail.size()) ans++;
				}
			}
		}
	}
	cout << ans << endl;
	return 0;
}