#include <bits/stdc++.h>
#include <cassert>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
/*
struct Edge
{
  int to;
  int weight;
  Edge(int t, int w) : to(t), weight(w) {}
};
using Graph = vector<vector<Edge>>;
*/
using Graph = vector<vector<int>>;

const long long INF = 1LL << 60;
const int INT_INF = 1000000000;

int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
// int dx[8] = {-1, -1, -1, 0, 0, 1, 1, 1}, dy[8] = {-1, 0, 1, 1, -1, 1, 0, -1};

int main()
{
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  string S;
  cin >> S;
  int cnt = 0;
  int xcnt = 0;
  int scnt = 0;
  for (int i = 0; i < S.size(); i++)
  {
    if (S[i] == 'o')
      cnt++;
    else if (S[i] == 'x')
      xcnt++;
    else
      scnt++;
  }
  if (cnt > 4 || xcnt == 10)
  {
    cout << 0 << endl;
    return 0;
  }
  if (cnt == 4)
  {
    cout << 4 * 3 * 2 << endl;
    return 0;
  }
  if (cnt == 3)
  {
    cout << 36 + scnt * 4 * 3 * 2 << endl;
    return 0;
  }
  if (cnt == 2)
  {
    cout << 14 + scnt * 3 * 4 * 3 * 2 / 2 + scnt * (scnt - 1) / 2 * 4 * 3 * 2 << endl;
    return 0;
  }
  if (cnt == 1)
  {
    cout << 1 + scnt * 14 + scnt * (scnt - 1) / 2 * 36 + scnt * (scnt - 1) * (scnt - 2) / 6 * 4 * 3 * 2 << endl;
    return 0;
  }
  if (cnt == 0)
  {
    cout << scnt + scnt * (scnt - 1) / 2 * 14 + scnt * (scnt - 1) * (scnt - 2) / 6 * 36 + scnt * (scnt - 1) * (scnt - 2) * (scnt - 3) / 24 * 4 * 3 * 2 << endl;
    return 0;
  }
  return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define pi pair<int, int>
#define endl '\n'
#define all(v) (v).begin(), (v).end()
#define FIO ios_base::sync_with_stdio(0), cin.tie(0)
#define fi first
#define se second

int fact(int n) {
    if (n <= 1) return 1;
    if (n == 2) return 2;
    if (n == 3) return 6;
    if (n == 4) return 24;
    return 0;
}

set<vector<int>> num;

void get(vector<int>& a, vector<int>& c, int i) {
    if (i == 4) {
        vector<int> x = a;
        sort(all(x));
        num.insert(x);
        return;
    }
    for (auto x : c) {
        a.pb(x);
        get(a, c, i + 1);
        a.pop_back();
    }
}

signed main() {
    FIO;
    string s;
    cin >> s;
    vector<int> a;
    set<int> v;
    for (int i = 0; i < 10; i++) {
        if (s[i] == 'o') {
            a.pb(i);
            v.insert(i);
        } else if (s[i] == '?') {
            v.insert(i);
        }
    }
    if (a.size() > 4) {
        cout << "0";
        return 0;
    }
    if (a.size() == 4) {
        cout << "24";
        return 0;
    }
    if (v.size() == 0) {
        cout << "0";
        return 0;
    }
    vector<int> c;
    for (auto it : v) c.pb(it);
    int i = a.size();
    get(a, c, i);
    int ans = 0;
    for (auto it : num) {
        unordered_map<int, int> freq;
        for (auto y : it) {
            freq[y]++;
        }
        int f = 24;
        for (auto p : freq) f /= fact(p.se);
        ans += f;
    }
    cout << ans;
}
