#include<bits/stdc++.h>
using namespace std;
#define int long long
string s;
int a,b,c;
int must[100];
signed main()
{
	cin>>s;
	for(int i=0;i<=9;i++) 
	{
		if(s[i]=='o') a++;
		if(s[i]=='x') b++;
		if(s[i]=='?') c++;
	}
	if(a>4) 
	{
		printf("0");
		return 0;
	}
	else
	{
		int ans=0;
		
		for(int i=0;i<=9999;i++)
		{
			for(int j=0;j<=9;j++)
			{	
				if(s[j]=='o') must[j]=true;
			}
			int now=i;
			int aa=now%10,bb=0,cc=0,dd=0;
			now/=10;
			if(now) 
			{
				bb=now%10;
				now/=10;
			}
			if(now)
			{
				cc=now%10;
				now/=10;
			}
			if(now)
			{
				dd=now%10;
				now/=10;
			}
			if(s[aa]!='x'&&s[bb]!='x'&&s[cc]!='x'&&s[dd]!='x')
			{
				int flag=0;
				for(int j=0;j<=9;j++)
				{
					if(must[j]==true)
					{
						if(j!=aa&&j!=bb&&j!=cc&&j!=dd) 
						{
							flag=1;
							break;
						}
					//	printf("%lld\n",j);
					}
				}
				if(flag==0)
				{
				//	cout<<s[9]<<endl;
				//	cout<<aa<<" "<<bb<<" "<<cc<<" "<<dd<<" "<<i<<" "<<endl;
					ans++;
				//	printf("%lld %lld %lld %lld\n",aa,bb,cc,dd);
				//	printf("%lld\n",i);
				}
			}
		}
		printf("%lld",ans);
	}
	return 0;
}
#include <cstdio>
#include <cmath>
#include <iostream>
using namespace std;
typedef long long ll;
ll n;
int main(){
	scanf("%lld",&n);
	ll x = 0;
	for(ll i = 1LL;i <= n;i++){
		if((i + 1)*i <= 2*(n + 1)) x = i;
		else break;
	}
	printf("%lld\n",n - x + 1);
	return 0;
} 