#include <iostream>                                                
#include <vector>  
#include <algorithm>
#include <string>
#include <set>
#include <vector>
#include <map>
#include <cmath>
#include <numeric>
#include<cctype>
#include<deque>
#include<iomanip>
#include<queue>
#include<cstring>
#include<stack>
#include<unordered_map>
#define endl "\n"

#define ll long long
using namespace std;

typedef vector<int> v_c;
typedef vector<v_c>vv_c;


ll gcd(ll m, ll n) {

	if (n == 0) {
		return m;
	}
	return gcd(n, m % n);
}
ll lcm(ll m, ll n) {
	return (m / gcd(m, n)) * n;
}



int main() {

	ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL);
		
	ll n;
	cin >> n;
	ll g = n;
	for (ll i = 2;i< n;i++) {
		g = lcm(g, i);
	}
	cout << g + 1 << endl;
	

	return 0;
}
#include <bits/stdc++.h>
#define REP(i, n)   for(int i=0; i<(int)(n); ++i)
#define ALL(x)      (x).begin(), (x).end()
template<class T> inline bool chmin(T& a, T b){if(a>b){a=b; return true;} return false;}
template<class T> inline bool chmax(T& a, T b){if(a<b){a=b; return true;} return false;}

using namespace std;

int main(){
  string s; cin >> s;
  vector<int> memory(10);
  for(int i=0; i<10; ++i){
    if(s[i] == 'o') memory[i] = 1;
    else if(s[i] == 'x') memory[i] = 0;
    else memory[i] = 2;
  }

  int ans = 0;

  for(int i=0; i<10000; ++i){
    ostringstream oss;
    oss << setfill('0') << setw(4) << i;
    string s = oss.str();
    bool correct = true;
    for(char c: s){
      int cint = c -'0';
      if(memory[cint] == 0){
        correct = false;
        break;
      }
    }
    for(int i=0; i<10; ++i){
      bool contain = false;
      if(memory[i] == 1){
        for(char c: s){
          if(c - '0' == i) contain = true;
        }
        if(!contain){
          correct = false;
          break;
        }
      }
    }
    if(correct) ans++;
  }
  cout << ans << endl;
  return 0;
}
