#include <bits/stdc++.h>
#define F first
#define S second
#define all(x) x.begin(),x.end()
#define endl '\n'

using namespace std;

using ll = long long;
using pii = pair<int, int>;
const int INF = 0x3f3f3f3f;
const ll INFLL = 0x3f3f3f3f3f3f3f3fLL;
const int MOD = 1000000007;
const int dx[] = { 0, 0, -1, 1, 1, -1,  1, -1};
const int dy[] = {-1, 1,  0, 0, 1, -1, -1,  1};

int main() {
  ios_base::sync_with_stdio(false); cin.tie(NULL);

  ll n;
  cin >> n;
  n = 2*n;
  auto cnt = [&](ll x){
    ll aux = n/x;
    aux -= x-1;
    return aux%2 == 0;
  };
  ll ans = 0; 
  for(ll d=1; d<=n/d; d++){
    if(n%d == 0){
      ans += cnt(d);
      if(d*d != n)
        ans += cnt(n/d);
    }
  }
  cout << ans << endl;
  return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define ll long long
template <class T = ll> using P = pair<T,T>;
template <class T = ll> using V = vector<T>;
template <class T = ll> using VV = V<V<T>>;
#define rep(i,n) for(int i=0; i<(n);++i)
#define repp(i, l, r) for(int i = (l); i < (r); ++i)
#define pb push_back
#define all(v) (v).begin(), (v).end()

// xのどれかにyを含むか
bool contain(int x, int y){
    if(x%10 == y) return true;
    else if((x/10)%10 == y) return true;
    else if((x/100)%10 == y) return true;
    else if((x/1000)%10 == y) return true;
    else return false;
}

int main()
{
    string s;
    cin >> s;
    int v[10] = {};
    rep(i, 10){
        if(s[i] == 'o'){
            v[i] = 0;
        }else if(s[i] == 'x'){
            v[i] = 1;
        }else{
            v[i] = 2;
        }
    }

    ll ans = 0;
    rep(i, 10000){
        bool ok = true;
        rep(j, 10){
            if(v[j] == 0){
                ok &= contain(i, j);
            }
            else if(v[j] == 1){
                ok &= !contain(i, j);
            }
        }
        if(ok) ans++;
    }

    cout << ans << endl;
    
    return 0;
}