#include <bits/stdc++.h>

using namespace std;

bool check(int x, string flag){
    for(int d = 0; d < 4; ++d){
        int id = x % 10;
        x/=10;
        if (flag[id] == 'x') return false;
        if (flag[id] == 'o') flag[id] = '?';
    }
    for(int d = 0; d < 10; ++d){
        if (flag[d] == 'o') return false;
    }
    return true;
}

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    string s;
    cin >> s;
    int ans = 0;
    for(int num = 0; num < 10000; ++num){
        if (check(num, s)) ans++;

    }
    cout << ans;
}

#include <bits/stdc++.h>
#define M 1000000007
#define endl '\n'
#define ll long long
using namespace std;

int main(){
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

   	string str;
   	cin>>str;
   	ll n=str.length();

   	ll cnt1{0}; //to count the number of 'o'
   	ll cnt2{0}; //to count the number of '?'
   	for(ll i=0;i<n;i++){
   		if(str[i]=='o')
   			cnt1++;
   		else if(str[i]=='?')
   			cnt2++;
   	}

   	if(cnt1>4){
   		cout<<0<<endl;
   	}
   	else if(cnt1==4){
   		cout<<24<<endl;
   	}
   	else if(cnt1==3){
   		ll ans=(36)+(24*cnt2);
   		cout<<ans<<endl;
   	}
   	else if(cnt1==2){
   		ll temp=(cnt2*(cnt2-1))/2;
   		ll ans=(14)+(cnt2*36)+(temp*24);
   		cout<<ans<<endl;
   	}
   	else if(cnt1==1){
   		ll temp1=(cnt2*(cnt2-1)*(cnt2-2))/6;
   		ll temp2=(cnt2*(cnt2-1))/2;
   		ll ans=(1)+(cnt2*14)+(temp2*36)+(temp1*24);
   		cout<<ans<<endl;
   	}
   	else if(cnt1==0){
   		ll temp1=(cnt2*(cnt2-1)*(cnt2-2)*(cnt2-3))/24;
   		ll temp2=(cnt2*(cnt2-1)*(cnt2-2))/6;
   		ll temp3=(cnt2*(cnt2-1))/2;
   		ll ans=(cnt2*1)+(temp3*14)+(temp2*36)+(temp1*24);
   		cout<<ans<<endl;
   	}

	return 0;
}
