#include <bits/stdc++.h>

using namespace std;

#define int long long

void solve(){
  int n; cin>>n;
  vector<int> v;
  for(int i = 1; i*i <= n; i++){
    if(n%i == 0){
      v.push_back(i);
      if(i*i != n) v.push_back(n/i);
    }
  }
  sort(v.begin(), v.end());
  for(int i : v) cout << i << "\n";
}

int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t=1; //cin>>t;
    while(t--) solve();
    return 0;    
}    
// Problem: C - Secret Number
// Contest: AtCoder - Mynavi Programming Contest 2021（AtCoder Beginner Contest 201）
// URL: https://atcoder.jp/contests/abc201/tasks/abc201_c
// Memory Limit: 1024 MB
// Time Limit: 2000 ms

#include <bits/stdc++.h>
using namespace std;

int main() {
	string str;
	cin >> str;
	int ans = 0;
	for (int i = 0; i < 10000; ++i) {
		bool flag = true;
		for (int k = 1; k <= 1000; k *= 10) {
			if (str[i / k % 10] == 'x') flag = false;	
		}
		for (int j = 0; j < 10; ++j) {
			bool vis = false;
			if (str[j] == 'o') {
				for (int k = 1; k <= 1000; k *= 10) {
					if (i / k % 10 == j) vis = true;	
				}
				if (!vis) flag = false;
			}
		}
		if (flag) ++ans;
	}
	cout << ans;
	return 0;
}