#include<bits/stdc++.h>
typedef long long ll;
typedef unsigned long long ull;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); mt19937 rng((unsigned int) chrono::steady_clock::now().time_since_epoch().count());
#define F first
#define S second
#define PI  4.0*atan(1.0);
#define pb push_back
using namespace std;
typedef pair<int, int> pi;
int mod=1e9+7,gaymod=998244353,MAX=1000000000,pomod=1073741824;
//long long int gcd(long long int x,long long int  y){
  // if(y==0)return x;
   //return gcd(y,x%y);
//}
int gcd(int x,int  y){
   if(y==0)return x;
   return gcd(y,x%y);
}
ll lcm(ll a, ll b)
{
    ll g=gcd(a, b);
    return a/g*b;
}
ll binexp(ll a,ll b){
if(b==0)return 1;
ll res=binexp(a,b/2);
if(b%2)return((res%mod)*(res%mod)*(a%mod));
else return((res%mod)*(res%mod));
}
int prime(ll x){
if(x%2==0&&x!=2)
return 0;
else if(x==1)return 0;
else{
    for(int i=3;ll(i*i)<=x;i+=2){
        if(x%i==0)
            return 0;
    }
}
return 1;
}
//main
/*
vector<char> is_prime(N+1, true);
void sieve(int n){
is_prime[0] = is_prime[1] = false;
for (int i = 2; i <= n; i++) {
    if (is_prime[i] && (long long)i * i <= n) {
        for (int j = i * i; j <= n; j += i)
            is_prime[j] = false;
    }
}
}
*/
//freopen("input.txt","r",stdin);
//freopen("input.txt","w",stdin);
const int N=2e5+5;
//
int main(){
IOS;
int t=1;
//cin>>t;
while(t--){
string str;
cin>>str;
int cnt=0,bnt=0;
for(auto i:str){
    if(i=='o')cnt++;
    else if(i=='?') bnt++;
}
if(cnt>4)cout<<0;
else{
    if(cnt==1){
        cout<<(bnt+1)*(bnt+1)*(bnt+1)*(bnt+1)-bnt*bnt*bnt*bnt;
    }
    else if(cnt==2){
    int l=bnt;
    bnt=bnt*(bnt-1);
    bnt/=2;
    bnt=max(bnt,0);
    cout<<14+36*l+24*bnt;
    }
    else if(cnt==3){
        cout<<36+bnt*24;
    }
    else if(cnt==4){
        cout<<24;
    }
    else{
        if(bnt==0)cout<<0;
        else cout<<bnt*bnt*bnt*bnt;
    }
}
cout<<"\n";
}
return 0;
}


#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string s;
  cin >> s;
  int ans=0;
  vector<int>a(10);
  for (int i=0;i<10;i++) {
    if(s[i]=='o'){
      a[i]=0;
    } 
    if(s[i]=='x'){
      a[i]=1;
    } 
    if(s[i]=='?'){
      a[i]=2;
    } 
  }
  bool d=1;
  vector<bool>b(10);
  for (int i=0;i<10;i++) {
    for (int j=0;j<10;j++) {
      for (int k=0;k<10;k++) {
        for (int l=0;l<10;l++) {
          d=1;
          for (int m=0;m<10;m++) {
            if(a[m]==0){
              b[m]=1;
            }
          }  
          if(a[i]==0){
            b[i]=0;
          }
          if(a[i]==1){
            d=0;  
          }
          if(a[i]==2){
            b[i]=0;
          }
          if(a[j]==0){
            b[j]=0;
          }
          if(a[j]==1){
            d=0;  
          }
          if(a[j]==2){
            b[j]=0;
          }
          if(a[k]==0){
            b[k]=0;
          }
          if(a[k]==1){
            d=0;  
          }
          if(a[k]==2){
            b[k]=0;
          }
          if(a[l]==0){
            b[l]=0;
          }
          if(a[l]==1){
            d=0;  
          }
          if(a[l]==2){
            b[l]=0;
          }
          for (int m=0;m<10;m++) {
            if(b[m]!=0){
              d=0;
            }
          }
          if(d){
            ans++;
          } 
        } 
      }
    }
  }
  cout << ans << endl;
}