//a+b = (a^b) + 2*(a&b)
//b^c = (a^b)^(a^c) 
//gcd(x,y) = gcd(x-y,y)
//if n = 5000 then complexity cannot be (n^2*log(n)) means no map ,no sets
//check for long long overflow if input is large
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define int long long
//#define mod 1000000007
#define mod 998244353
#define pb push_back
#define ll long long
#define fi first
#define se second
#define vi vector<int> 
#define pii pair<int,int>
#define mii map<int,int>
#define loop(i,n) for(int i=0;i<n;i++) 
#define pp  ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL) 
#define fill(a,b) memset(a, b, sizeof(a))
#define all(x) (x).begin(), (x).end()
 
#define en cout<<"\n"

#define trace(x) cout<<#x<<": "<<x<<" "<<endl
#define trace2(x,y) cout<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x,y,z) cout<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a,b,c,d) cout<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
 
using namespace __gnu_pbds;
using namespace std;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;
//member functions :
//1. order_of_key(k) : number of elements strictly lesser than k
//2. find_by_order(k) : k-th element in the set
const long long INF = 2000000000000000000;

long long power(long long a,long long b){
    long long ans=1;
    while(b>0){
        if(b&1){ans=(ans*a)%mod;}
                a=(a*a)%mod;
                b>>=1;
        }
    return ans; 
}

void solve()
{
	string s;
	cin>>s;
	int cto=0,ctx=0,n=s.size();
	int t = (4*3*2*1);
	for(int i=0;i<n;i++)
	{
		if(s[i]=='o') cto++;
		else if(s[i]=='?') ctx++;
	}
	if(cto>4 || (cto+ctx==0)) 
	{
		cout<<0;return;
	}
	if(cto==4)
	{
		cout<<t;return;
	}
	if(cto==3)
	{
		int ans = (3*t )/2;
		ans+= ctx*t;
		cout<<ans;
	}
	if(cto==0)
	{
		int ans=ctx;
		if(ctx>=4)
		{
			ans+= ctx*(ctx-1)*(ctx-2)*(ctx-3);
		}
		if(ctx>=3)
		{
			ans+= ctx*(ctx-1)*(ctx-2)*6;
		}
		if(ctx>=2)
		{
			ans+= ctx*(ctx-1)*4;
			ans+= ctx*(ctx-1)*3;
		}
		cout<<ans;
	}
	if(cto==2)
	{
		int ans = 6;
		ans+= 8;
		ans+= (ctx*2)*12;
		if(ctx>=2)
		ans+= (ctx*(ctx-1))*12;
		ans+= ctx*12;
		cout<<ans;
	}
	if(cto==1)
	{
		int ans = 1;
		ans+= (ctx*4);
		ans+= (ctx*(ctx-1))*6;
		ans+= ctx*6;
		
		ans+= ctx*4;
		ans+= ctx*(ctx-1)*12;
		ans+= ctx*(ctx-1)*(ctx-2)*4;
		cout<<ans;
	}
}

int32_t main() 
{
pp;
int test=1;
//cin>>test;
while(test--)
{
	solve();
	en;
}
return 0 ;
}
#include<bits/stdc++.h>
using namespace std;
bool check1(int n,vector<int>a)
{
    int pow;
    for(int i=0;i<a.size();i++)
    {
        pow=1;
        int flag=0;
        for(int j=0;j<4;j++)
        {
            if((n/pow)%10==a[i])
            flag=1;
            pow*=10;
        }
        if(flag==0)
        return false;
    }
    return true;
}
bool check2(int n,vector<int>a)
{
    int pow;
    for(int i=0;i<a.size();i++)
    {
        pow=1;
        int flag=0;
        for(int j=0;j<4;j++)
        {
            if((n/pow)%10==a[i])
            flag=1;
            pow*=10;
        }
        if(flag==1)
        return false;
    }
    return true;
}
int main()
{
    string s;
    cin>>s;
    vector<int>a,b;
    for(int i=0;s[i];i++)
    {
        if(s[i]=='o')
        a.push_back(i);
        else if(s[i]=='x')
        b.push_back(i);
    }
    if((a.size()>4)||(b.size()>9))
    {
    cout<<"0";return 0;}
    int count=0;
    for(int i=0;i<10000;i++)
    {
        if(check1(i,a)==true&&check2(i,b)==true)
        {
            count++;
        }
    }
    cout<<count;
    return 0;
}