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

int main() {
  string S;
  int A = 0, B = 0, result = 0;
  int C1, C2, C3, C4;

  cin >> S;
  
  for (int i = 0; i < 10; i++) {
    if (S[i] == 'o') {
      A++;
    } else if (S[i] == '?') {
      B++;
    }
  }

  C1 = 1;
  C2 = 14;
  C3 = 36;
  C4 = 24;

  if (A == 0) {
    result = B*B*B*B;
  } else if (A == 1) {
    result = C1 + B*C2 + B*(B-1)*C3/2 + B*(B-1)*(B-2)*C4/6;
  } else if (A == 2) {
    result = C2 + B*C3 + B*(B-1)*C4/2;
  } else if (A == 3) {
    result = C3 + B*C4;
  } else if (A == 4) {
    result = C4;
  }

  cout << result << endl;
}
#include <bits/stdc++.h>
#include <iostream>
#define ll long long
using namespace std;

const int M = 1e9 + 7;
ll mod(ll x) { return (x % M + M) % M; }

ll mul(ll a, ll b) { return mod((mod(a) * mod(b))); }

ll add(ll a, ll b) { return mod(mod(a) + mod(b)); }

void solve() {
  string s;
  cin >> s;
  int ok = 0;
  int maybe = 0;
  for (auto i : s) {
    if (i == 'o')
      ok++;
    else if (i == '?')
      maybe++;
  }
  int total = 0;
  for (int i = 0; i <= 9; i++) {
    for (int j = 0; j <= 9; j++) {
      for (int k = 0; k <= 9; k++) {
        for (int l = 0; l <= 9; l++) {
          set<int> ss;
          if (s[i] == 'x' || s[j] == 'x' || s[k] == 'x' || s[l] == 'x')
            continue;
          if (s[i] == 'o')
            ss.insert(i);
          if (s[j] == 'o')
            ss.insert(j);
          if (s[k] == 'o')
            ss.insert(k);
          if (s[l] == 'o')
            ss.insert(l);
          if ((int)ss.size() == ok)
            total++;
        }
      }
    }
  }
  cout << total;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout << fixed;
  cout << setprecision(10);
  //        freopen("timber_input.txt", "r", stdin);
  //        freopen("timber_output.txt", "w", stdout);
  int t = 1;
  // cin>>t;
  for (int i = 1; i <= t; i++) {
    //    cout<<"Case #"<<i<<": ";
    solve();
  }
  return 0;
}
