#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
typedef long long ll;

int main(){
	string s; cin>>s;
	ll cnt=0;
	for(int k=0; k<10000; k++){
		bool ans=true;
		string r=to_string(k);
		if(r.size()<4) r=string(4-r.size(),'0')+r;
		for(int i=0; i<10; i++){
			if(s[i]=='o'){
				bool flg=false;
				for(int j=0; j<4; j++){
					if(r[j]-'0'==i) flg=true;
				}
				if(!flg) ans=false;
			}else if(s[i]=='x'){
				bool flg=true;
				for(int j=0; j<4; j++){
					if(r[j]-'0'==i) flg=false;
				}
				if(!flg) ans=false;
			}
		}
		if(ans) cnt++;
	}
	cout<<cnt<<endl;
}
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define int long long
#define ll long long
#define F(type, i, a, b, incr) for (type i = a; i <= (type)(b); i += (type)(incr))
#define RF(type, i, a, b, decr) for (type i = a; i >= (type)(b); i -= (type)(decr))
#define sz(a) sizeof(a)
#define deb(a) cerr << " [" << #a << "->" << a << "] "
#define next_line cerr << '\n'
#define all(a) a.begin(), a.end()
#define iter(it, s) for (auto it = s.begin(); it != s.end(); it++)
#define setbits(x) __builtin_popcountll(x)
using namespace __gnu_pbds;
using namespace std;

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;
typedef pair<int, int> pii;
typedef pair<ll,ll> pll;

vector<int> Fact(11);

int ncr(int n, int r){
    return (Fact[n] / (Fact[n - r] * Fact[r]));
}

void solve()
{
    string s;
    cin >> s;   
    int o_c = 0, q_c = 0;
    for(char c: s){
        o_c += (c == 'o');
        q_c += (c == '?');
    }
    int ans=0;
    F(int, i, 0, 9, 1){
        if(s[i] == 'x')
            continue;
        F(int, j, 0, 9, 1){
            if(s[j] == 'x')
                continue;
            F(int, k, 0, 9, 1){
                if(s[k] == 'x')
                    continue;
                F(int, l, 0, 9, 1){
                    if(s[l] == 'x')
                        continue;
                    set<int> st;
                    st.insert(i);
                    st.insert(j);
                    st.insert(k);
                    st.insert(l);
                    int ps_g = o_c;
                    for(int x: st)
                        ps_g = ps_g - (s[x] == 'o');
                    if(ps_g > 0)
                        continue;
                    ans ++;
                }
            }
        }
    }
    cout << ans << '\n';
}

signed main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    #ifndef ONLINE_JUDGE
        // freopen("input.txt", "r", stdin);
        // freopen("output.txt", "w", stdout);
        // freopen("Debug.txt", "w", stderr);
    #else
    #endif
    Fact[0] = 1;
    F(int, i, 1, 10, 1){
        Fact[i] = Fact[i - 1] * i;
    }
    // cout << fixed << setprecision(10);
    // int _t;
    // cin>>_t;
    // F(int, i, 1, _t, 1){
        // cout << "Case #" << i << ": ";
        solve();
    // }
}
