#include <bits/stdc++.h>
 
using namespace std;

#define pb push_back
#define mp make_pair
#define ll long long
#define int ll
#define ld long double
#define reps(i,s,n) for(int i=(s);i<(int)(n);i++) 
#define rep(i,n) reps(i,0,n)
#define rreps(i,s,n) for(int i=(int)(s-1);i>=n;i--) 
#define rrep(i,n) rreps(i,n,0)
#define all(v) (v).begin(),(v).end()
#define mset(a,n) memset(a,n,sizeof(a))
#define eras(v,n) (v).erase(remove(all(v),n),(v).end())
#define uni(v) sort(all(v));(v).erase(unique(all(v)),(v).end())
#define bcnt(i)  __builtin_popcount(i)
#define fi first
#define se second
constexpr ll INF = 1e18;
constexpr ll MOD = 1000000007;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
template<class T>T min(vector<T> &v) { return *min_element(v.begin(),v.end()); }
template<class T>T max(vector<T> &v) { return *max_element(v.begin(),v.end()); }
template<class T>T modpow(T a, T b, T m) { a %= m; T r = 1; while (b > 0) { if (b & 1) r = (r * a) % m; a = (a * a) % m; b >>= 1; } return r; }
ll modinv(ll a,ll m=MOD) {ll b = m, u = 1, v = 0;while (b) {ll t = a / b;a -= t * b; swap(a, b);u -= t * v; swap(u, v);}u %= m;if (u < 0) u += m;return u;}
template<class T>string radixconv(T n, T k){ string s; while(n/k){ s=to_string(n%k)+s; n/=k; } s=to_string(n%k)+s; return s; }

int32_t main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout << fixed << setprecision(11);
    cerr << fixed << setprecision(6);
    string s;
    cin >> s;
    int ocnt=count(all(s),'o');
    int ans=0;
    cerr << ocnt << endl;
    rep(a,10)rep(b,10)rep(c,10)rep(d,10){
        if(s[a]=='x')continue;
        if(s[b]=='x')continue;
        if(s[c]=='x')continue;
        if(s[d]=='x')continue;
        vector<bool> chk(10,0);
        chk[a]=1;
        chk[b]=1;
        chk[c]=1;
        chk[d]=1;
        int cnt=0;
        rep(i,10)if(chk[i]&&s[i]=='o')cnt++;
        if(cnt!=ocnt)continue;
        ans++;
    }
    cout << ans << endl;
    return 0;
}


#include<bits/stdc++.h>
 
using namespace std;
 
int main(){
       ios_base::sync_with_stdio(0);
string s; cin >> s;
  int onum =0, qnum = 0;
  int i;
  for(i = 0;i<10;i++){
    if(s[i] == 'o'){
      onum++;
    }else if(s[i] == '?'){
      qnum++;
    }
  }
  if(onum > 4){
    cout << 0 << endl;
  }else if(onum == 4){
    cout << 24 << endl;
  }else if(onum == 3){
    cout << 36 + 24 * qnum << endl;
  }else if(onum == 2){
    cout << 4 + 6 + 4 + (qnum - 1) * qnum / 2 * 24 + qnum * 36 << endl;
  }else if(onum == 1){
    cout << 1 + qnum * 14 + (qnum - 1) * qnum / 2 * 36 + (qnum - 2) * (qnum - 1) * qnum / 6 * 24 << endl;
  }else{
    cout << qnum * qnum * qnum * qnum << endl;
  }
   
   
   
   
return 0;
}