#include <bits/stdc++.h>

using namespace std;

#define LL long long
#define r 1000000007
#define pb push_back
#define pf push_front
#define loop(i,a,b) for (LL i = a; i < b; i++)

#define numberOfOnes(n) __builtin_popcountll(n)
#define parity(n) __builtin_parityll(n)             // = 1 when numberOfOnes(n) is odd
#define leadingZeros(n) __builtin_clzll(n)
#define trailingZeros(n) __builtin_ctzll(n)

double prod[90] = {0};

void mul(double c[], double q[]) {
	loop(i, 0, 90) {
		prod[i] = 0;
	}
	loop(i, 0, 90) {
		loop(j, 0, 90) {
			if (i + j < 90) {
				prod[i + j] += c[i] * q[j];
			}
		}
	}
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);

	char c;

	LL o = 0, x = 0, q = 0;
	loop(i, 0, 10) {
		cin >> c;
		if (c == 'o') {
			o++;
		}
		else if (c == 'x') {
			x++;
		}
		else if (c == '?') {
			q++;
		}
	}
	// cout << o;

	double on[90] = {0};
	double qn[90] = {0};
	double sum[90] = {0};

	on[1] = 1;
	on[2] = (float)1 / 2;
	on[3] = (float)1 / 6;
	on[4] = (float)1 / 24;

	qn[0] = 1;
	qn[1] = 1;
	qn[2] = (float)1 / 2;
	qn[3] = (float)1 / 6;
	qn[4] = (float)1 / 24;

	if (o > 0) {
		loop(i, 0, 5) {
			sum[i] = on[i];
		}
		if (o > 1) {
			loop(i, 0, o - 1) {
				mul(sum, on);
				loop(j, 0, 90) {
					sum[j] = prod[j];
				}
			}
		}
		if (q > 0) {
			loop(i, 0, q) {
				mul(sum, qn);
				loop(j, 0, 90) {
					sum[j] = prod[j];
				}
			}
		}
	}
	else if (q > 0) {
		loop(i, 0, 5) {
			sum[i] = qn[i];
		}
		if (q > 1) {
			loop(i, 0, q - 1) {
				mul(sum, qn);
				loop(j, 0, 90) {
					sum[j] = prod[j];
				}
			}
		}
	}
	else {
		cout << 0;
		return 0;
	}

	cout << 24.0 * sum[4];

	return 0;
}
#include "bits/stdc++.h"
using namespace std;

int main(){
	string s; cin>>s;
	int cnt = 0;
	for(int i = 0; i<=9999; i++){
		vector<bool>a(10);
		int pss = i;
		for(int j = 0; j<4; j++){
			a[pss%10] = 1;
			pss /= 10;
		}
		bool ok = 1;
		for(int k = 0; k<10; k++){
			if(s[k]=='o'&&!a[k])ok = 0;
			if(s[k]=='x'&&a[k])ok = 0;
		}
		if(ok)cnt++;
	}
	cout<<cnt<<endl;
}