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

typedef long long int ll;
typedef pair<ll, ll> p_ll;
typedef vector<pair<ll, ll>> vec_p; //vector<pair<ll, ll>> pairs(n) ,pairs.at(i) = make_pair(i*i, i)

#define ture ture
#define flase false
#define falg flag

#define REP(i, x) for (ll i = 0; i < (ll)(x); i++)
#define REPS(i, x) for (ll i = 1; i <= (ll)(x); i++)
#define RREP(i, x) for (ll i = ((ll)(x)-1); i >= 0; i--)
#define RREPS(i, x) for (ll i = ((ll)(x)); i > 0; i--)
#define all(x) (x).begin(), (x).end()

const ll MOD = pow(10, 9) + 7;
const ll LLINF = pow(2, 61) - 1;//llの最大9*10^18
const int INF = pow(2, 30) - 1;

ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }

ll comb(ll n,ll k){
    ll ans = 1;
    REP(i, k)
    {
        ans *= n - i;
        ans /= i + 1;
    }
    return ans;
}

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

    ll N;
    string S;
    cin >> S;
    ll ans = 0;

    REP(i,10){
        REP(j,10){
            REP(k,10){
                REP(l,10){
                    bool flag = true;

                    REP(a,10){
                        if(S.at(a)=='o'){
                            if (a == i || a == j || a == k || a == l)
                            {
                            }
                            else
                            {
                                flag = false;
                                break;
                            }
                        }
                        else if(S.at(a)=='x'){
                            if (a == i || a == j || a == k || a == l){
                                flag = false;
                                break;
                            }
                            else{

                            }
                        }
                    }

                    if(flag){
                        ans++;
                    }
                    flag = true;
                }
            }
        }
    }
    cout << ans << endl;

    /*ll ok = 0, ng = 0, hatena = 0;
    REP(i,10){
        if(S.at(i)=='o'){
            ok++;
        }
        else if(S.at(i)=='x'){
            ng++;
        }
        else{
            hatena++;
        }
    }

    if(ok>=5){
        cout << 0 << endl;
    }
    else if(ng)*/
}

/**
*    author:  shu8Cream
*    created: 15.05.2021 20:32:47
**/

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i=0; i<(n); i++)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
using ll = long long;
using P = pair<ll,ll>;
using vi = vector<ll>;
using vvi = vector<vi>;

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    string s; cin >> s;
    ll n = s.size();
    ll maru = 0, batsu = 0, hate = 0;
    rep(i,n){
        if(s[i]=='o') maru++;
        if(s[i]=='x') batsu++;
        if(s[i]=='?') hate++;
    }
    ll ans = 0;
    rep(i,10)rep(j,10)rep(k,10)rep(l,10){
        string t = "xxxxxxxxxx";
        t[i] = 'o';
        t[j] = 'o';
        t[k] = 'o';
        t[l] = 'o';
        bool f = true;
        rep(_,10){
            if(s[_]=='x' && t[_]=='o') f = false;
            if(s[_]=='o' && t[_]=='x') f = false;
        }
        if(f) ans++;
    }
    cout << ans << endl;
}