#include<bits/stdc++.h>
using namespace std;
#define fastIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define int long long int
#define fi first
#define se second
#define pub push_back
#define pi pair<int,int>
#define all(v) (v).begin(), (v).end()
#define rep(i, l, r) for(int i=(int)(l);i<(int)(r);i++)
#define repd(i, l, r) for (int i=(int)(l);i>=(int)(r);i--)
#define clrg(i, l, r) for(int i=(int)(l);i<(int)(r);i++)vis[i]=0,v[i].clear();
int power(int x, unsigned int y){int res = 1;while (y > 0){ if (y & 1){res = res*x;} y = y>>1;x = x*x;}return res;}
int powermod(int x, unsigned int y, int p){int res = 1;x = x % p;while (y > 0){if (y & 1){res = (res*x) % p;}y = y>>1; x = (x*x) % p;}return res;}
#define print2d(mat,n,m){for(int i=0;i<(int)(n);i++){for(int j=0;j<(m);j++){cout<<mat[i][j]<<" ";}cout<< endl;}}
#define clr(a,x) memset(a,x,sizeof(a))
#define rr(v) for(auto &val:v)
#define print(v) for (const auto itr : v){cout<<itr<<' ';}cout<<"\n";
#define ln length()
#define sz size()
#define mod 1000000007
#define elif else if
int32_t main(){
   fastIO
   string st; cin>>st;
   int ans=0;
    rep(i,0,10){
        rep(j,0,10){
            rep(k,0,10){
                rep(p,0,10){
                    string s="";
                    s+=char('0'+i);
                    s+=char('0'+j);
                    s+=char('0'+k);
                    s+=char('0'+ p);
                    bool okk=1;
                    rep(c,0,10){
                        if(st[c]=='o'){
                            bool ok=0;
                            rep(c1,0,4){
                                if((s[c1])-'0'==c)ok=1;
                            }
                            if(!ok)okk=0;
                        }
                        elif(st[c]=='x'){
                            bool ok=1;
                            rep(c1,0,4){
                                 if((s[c1])-'0'==c)ok=0;
                            }
                            if(!ok)okk=0;
                        }
                    }
                    if(okk)ans++;
                }
            }
        }
    }
    cout<<ans<<"\n";
   return 0;
}

#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;

string s;
long long n=10,a[11],b[11],c[5],ans,p;

int main(){
	long long i,j,u,v;
	cin>>s;
	for(i=0;i<n;i++){
		if(s[i]=='o') a[i]=1;
		if(s[i]=='x') a[i]=-1;
	}
	for(i=0;i<=9999;i++){
		u=i;
		memset(b,0,sizeof(b));
		c[1]=u%10;u/=10;b[c[1]]=1;
		c[2]=u%10;u/=10;b[c[2]]=1;
		c[3]=u%10;u/=10;b[c[3]]=1;
		c[4]=u%10;u/=10;b[c[4]]=1;
		p=0;
		for(j=0;j<n;j++){
			if(a[j]==1 && b[j]==0){
				p=1;
				break;
			}
			if(b[j]==1 && a[j]==-1){
				p=1;
				break;
			}
		}
		if(!p) ans++;
	}
	cout<<ans<<endl;
	return 0;
}