#include<bits/stdc++.h>

using namespace std;

void solve(){
	string s; cin >> s;
	int go = 0, ma = 0;
	for(char c : s){
		if(c == 'o')go++;
		if(c == '?')ma++;
	}
	int ans = 0;
	for(int i = 0; i < 10000; ++i){
		string no = to_string(i);
		while(no.size() < 4)no = '0'+no;
		string co = "xxxxxxxxxx";
		for(char c : no){
			co[c-'0']='o';
		}
		bool ok = 1;
		for(int i = 0; i < 10; ++i){
			if(co[i] == 'o' && s[i] == 'x')ok = 0;
			if(co[i] == 'x' && s[i] == 'o')ok = 0;
		}
		ans+=ok;

	}
	cout << ans << "\n";
}

int main(){
	solve();
}

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

int main()
{
  ull n, a; cin >> n;
  ull ans = 0;
  vector<ull> mod(200);
  rep(i, n)
  {
    cin >> a;
    mod.at(a % 200)++;
  }
  rep(i, 200)
  {
    if (mod.at(i) > 0) ans += mod.at(i) * (mod.at(i)-1) / 2;
  }
  cout << ans << endl;
}

