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

int main(){
  string S;
  cin >> S;
  int o=0,x=0,q=0;
  for(int i=0;i<10;i++){
    if(S[i]=='o') o++;
    if(S[i]=='x') x++;
    if(S[i]=='?') q++;
  }
  
  int ans = 0;
  for(int i=0;i<10000;i++){
    vector<int> V(10,0);
    int now = i;
    for(int j=0;j<4;j++){
      V[now%10]++;
      now /= 10;
    }
    
    bool ok = true;
    for(int j=0;j<o;j++){
      if(V[j]==0) ok = false;
    }
    for(int j=o;j<o+x;j++){
      if(V[j]!=0) ok = false;
    }
    if(ok) ans++;
  }
  
  cout << ans << endl;
  return 0;
}

#include <iostream>
#include <algorithm>
#include <string>
#include <cstring>
#include <cstdio>

using namespace std;
int main()
{
    string s;
    cin >> s;
    int ans_o = 0, ans_p = 0;
    for(int i = 0; i < s.length(); ++i){
        if(s[i] == 'o') ans_o++;
        if(s[i] == '?') ans_p++;
    }
    if(ans_o > 4) {
        cout << 0 << endl;
    }
    else if(ans_o == 4){
        cout << 24 << endl;
    }
    else if(ans_o == 3){
        cout << ans_p*24+36<<endl;
    }
    else if(ans_o == 2){
        cout << 14+ans_p*36+ans_p*(max(0,ans_p-1))*12<<endl;
    }
    else if(ans_o == 1){
        cout << 1+ans_p*14+ans_p*(max(0,ans_p-1))*18+ans_p*(max(0, ans_p-1))*(max(0,ans_p-2))*4<<endl;
    }
    else{
        cout << ans_p+ans_p*(max(0,ans_p-1))*7+ans_p*(max(0, ans_p-1))*(max(0,ans_p-2))*6+ans_p*(max(0, ans_p-1))*(max(0,ans_p-2))*(max(0,ans_p-3))<<endl;
    }
    return 0;
}