#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <math.h>
#include <algorithm>
#include <map>
#include <queue>
#include <climits>
#define rep(i,n) for (int i=0;i<(n);i++)

using namespace std;
long long MAX = 100005;
long long N, M, Y, K;
string S,T;
//vector<int> g(Max);

int main() {
	string s;
	cin >> s;
	int o_num = 0;
	int nate_num = 0;
	for (int i = 0;i < s.length();i++) {
		if (s[i] == 'o') {
			o_num++;
		}
		else if (s[i] == '?') {
			nate_num++;
		}
	}
	int ans = 0;
	if (o_num > 4) {
		cout << 0 << endl;
		return 0;
	}
	else if(o_num == 4)
	{
		ans = 4 * 3 * 2;
	}
	else if(o_num == 3){
		ans += 4 * (3 * 2) * (nate_num);//はてなあり
		ans += 3 * 2 * 3 * 2;//はてななし
	}
	else if (o_num == 2) {
		ans += (3 * 2) * 2 * (nate_num * nate_num);//はてな2
		ans += 4 * 6 * (nate_num);//はてな1
		ans += 14;//はてななし
	}
	else if (o_num == 1) {
		ans += 4 * pow(nate_num, 3);//はてな3
		ans += (3 * 2) * (nate_num * nate_num);//はてな2
		ans += 4 * (nate_num);//はてな1
		ans += 1;//はてななし
	}
	else if (o_num == 0) {
		ans += pow(nate_num, 4);
	}

	cout << ans << endl;
	return 0;
}
// L:27
#include <bits/stdc++.h>
#define MOD 1000000007
#define INF 1000000000
#define LINF 1000000000000000000
#define rep(i,n) for(int i=0;i<n;i++)
#define ALL(a) a.begin(),a.end()
#define PB(a) push_back(a)
using namespace std;
using ll=long long;
using P=pair<int,int>;
const int dx[]={0,-1,1,0},dy[]={-1,0,0,1};
//const int dx[]={-1,0,1,-1,1,-1,0,1},dy[]={-1,-1,-1,0,0,1,1,1};
ll modpow(ll a,ll k,ll m) {
   ll r=1;
   while(k>0) {
      if(k&1) r=r*a%m;
      a=a*a%m;
      k>>=1;
   }
   return r;
}
int main(void) {
   cin.tie(0);
   ios::sync_with_stdio(0);
   cout << fixed << setprecision(7);
   string s; cin >> s;
   int ans=0;
   vector<int> o,x;
   rep(i,10) {
      if(s[i]=='o') o.PB(i);
      else if(s[i]=='x') x.PB(i);
   }
   rep(i,10000) {
      int a,b,c,d;
      a=i%10;
      b=i%100/10;
      c=i%1000/100;
      d=i/1000;
      bool f=true;
      rep(j,o.size()) {
         if(!(o[j]==a || o[j]==b || o[j]==c || o[j]==d) ) f=false;
      }
      rep(j,x.size()) {
         if(x[j]==a || x[j]==b || x[j]==c || x[j]==d) f=false;
      }
      if(f) ans++;
   }
   cout << ans << endl;
   return 0;
}
