#include <bits/stdc++.h>
#define FOR(i, a, n) for(ll i = (ll)a; i < (ll)n; i++)
#define FORR(i, n) for(ll i = (ll)n - 1LL; i >= 0LL; i--)
#define rep(i, n) FOR(i, 0, n)
#define ALL(x) begin(x), end(x)
using namespace std;
using ll = long long;
constexpr ll Mod = 998244353;
constexpr ll mod = 1e9 + 7;
constexpr ll inf = 1LL << 60;
const double PI = acos(-1);
template <typename T1, typename T2>
inline bool chmax(T1 &a, T2 b) {
    return a < b && (a = b, true);
}
template <typename T1, typename T2>
inline bool chmin(T1 &a, T2 b) {
    return a > b && (a = b, true);
}
/*-------------------------------------------*/

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

    string s;
    cin >> s;

    int a = count(ALL(s), 'o');
    int b = count(ALL(s), 'x');
    int c = count(ALL(s), '?');

    ll cnt = 0;
    const int ar[5] = {0, 1, 14, 36, 24};

    rep(i, 1 << c) {
        int t = __builtin_popcount(i);
        if(a + t <= 4) cnt += ar[a + t];
    }

    cout << cnt << endl;

    return 0;
}
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <utility>

using namespace std;
using ll = long long;
using ull = unsigned long long;
#define rep(i,n) for(int i=0; i<(n); i++)


int main(){
  string S; cin >> S;
  int ans = 0;
  rep(i,10000){
    int K[4] = {i/1000,i/100%10,i/10%10,i%10};
    int C[10] = {}; rep(t,4) C[K[t]] = 1;
    bool ok = true;
    rep(d,10) if(C[d] == 0 && S[d] == 'o') ok = false;
    rep(d,10) if(C[d] == 1 && S[d] == 'x') ok = false;
    if(ok) ans++;
  }
  cout << ans << "\n";
  return 0;
}


struct ios_do_not_sync{
  ios_do_not_sync(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
  }
} ios_do_not_sync_instance;

