#include <bits/stdc++.h>
using namespace std;
struct _ {
  _() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
  }
} _;
template <class A, class B>
ostream &operator<<(ostream &o, pair<A, B> t) {
  o << "(" << t.first << ", " << t.second << ")";
  return o;
}
template <class T>
T convert(string s) {
  T first;
  stringstream(s) >> first;
  return first;
}
template <class T>
string tostring(T first, int len = 0, char c = '0') {
  stringstream ss;
  ss << first;
  string r = ss.str();
  if (r.length() < len) r = string(len - r.length(), c) + r;
  return r;
}
template <class T>
void PV(T a, T b, int n = 0, int w = 0, string s = " ") {
  int c = 0;
  while (a != b) {
    cout << tostring(*a++, w, ' ');
    if (a != b && (n == 0 || ++c % n))
      cout << s;
    else
      cout << "\n";
  }
}
template <class T>
inline bool chmin(T &a, T b) {
  return a > b ? a = b, 1 : 0;
}
template <class T>
inline bool chmax(T &a, T b) {
  return a < b ? a = b, 1 : 0;
}
const long long linf = 0x3f3f3f3f3f3f3f3fLL;
const int inf = 0x3f3f3f3f;
const int mod = int(1e9) + 7;
const int N = 1000001;
vector<int> prime;
vector<int> minFactor;
vector<bool> isp;
void generatePrime(int n = N) {
  isp.resize(n + 1, 1), isp[0] = isp[1] = 0;
  minFactor.resize(n + 1);
  for (int i = 1; i <= n; i++) minFactor[i] = i;
  for (int i = 2; i <= n; i++) {
    if (!isp[i]) continue;
    prime.push_back(i);
    for (int j = i + i; j <= n; j += i) {
      isp[j] = 0;
      if (minFactor[j] == j) minFactor[j] = i;
    }
  }
}
namespace MillerRabin {
inline long long longMul(long long a, long long b, long long m) {
  if (a >= m) a %= m;
  if (b >= m) b %= m;
  if (m < INT_MAX || 2.0 * a * b < LONG_MAX) return a * b % m;
  long long res = 0, d = a;
  while (b > 0) {
    if (b & 1)
      if ((res += d) >= m) res -= m;
    if ((d += d) >= m) d -= m;
    b >>= 1;
  }
  return res;
}
inline long long longExp(long long first, long long n, long long m) {
  long long r = 1 % m;
  while (n > 0) {
    if (n & 1) r = longMul(r, first, m);
    first = longMul(first, first, m);
    n >>= 1;
  }
  return r;
}
int witness(long long n, int B) {
  long long m = n - 1, s = -1;
  while (m % 2 == 0) m >>= 1, s++;
  long long res = longExp(B, m, n);
  if (res == 1 || res == n - 1) return 1;
  while (s >= 0) {
    res = longMul(res, res, n);
    if (res == n - 1) return 1;
    s--;
  }
  return 0;
}
int isprime(long long n) {
  if (n < 6) return n == 2 || n == 3 || n == 5;
  if (n % 2 == 0 || n % 3 == 0 || n % 5 == 0) return 0;
  if (n <= 37) return 1;
  if (n % 7 == 0 || n % 11 == 0 || n % 13 == 0) return 0;
  if (witness(n, 2) == 0) return 0;
  if (witness(n, 3) == 0) return 0;
  if (witness(n, 5) == 0) return 0;
  if (n < 25326001LL) return 1;
  if (witness(n, 7) == 0) return 0;
  if (n < 25000000000LL) return n != 3215031751LL;
  if (witness(n, 11) == 0) return 0;
  if (n < 2152302898747LL) return 1;
  if (witness(n, 13) == 0) return 0;
  if (n < 3474749660383LL) return 1;
  if (witness(n, 17) == 0) return 0;
  if (n < 341550071728321LL) return 1;
  if (witness(n, 19) == 0) return 0;
  if (witness(n, 23) == 0) return 0;
  if (witness(n, 29) == 0) return 0;
  if (witness(n, 31) == 0) return 0;
  if (witness(n, 37) == 0) return 0;
  return 1;
}
};  // namespace MillerRabin
int res;
void dfs(int i, long long A) {
  if (A == 1) {
    res++;
    return;
  }
  if (i == prime.size()) {
    if (MillerRabin::isprime(A - 1)) res++;
    return;
  }
  if (prime[i] + 1 > A) return;
  dfs(i + 1, A);
  long long cur = 1;
  while (1) {
    cur *= prime[i];
    if (cur + 1 > A) break;
    if (A % (cur + 1) == 0) dfs(i + 1, A / (cur + 1));
  }
}
long long d[N];
long long J(int first) {
  long long val = 1;
  for (int i = 0; prime[i] * prime[i] <= first; i++) {
    int second = 1;
    while (first % prime[i] == 0) first /= prime[i], second *= prime[i];
    if (second > 1) val *= (1 + second);
  }
  if (first > 1) val *= (1 + first);
  return val;
}
vector<long long> g[N];
map<long long, long long> dp;
int main() {
  generatePrime();
  long long A = 25082265600LL;
  cin >> A;
  for (int i = 0; i < prime.size(); i++) {
    long long first = prime[i];
    while (first <= A) {
      if (A % (1 + first) == 0) g[i].push_back(1 + first);
      first *= prime[i];
    }
  }
  dp[1] = 1;
  map<long long, long long> add;
  for (int i = 0; i < prime.size(); i++) {
    if (g[i].size() == 0) continue;
    add.clear();
    for (auto j : dp) {
      for (long long k : g[i]) {
        if (A / j.first % k == 0) {
          long long first = j.first * k;
          add[first] += j.second;
        }
      }
    }
    for (auto t : add) dp[t.first] += t.second;
  }
  for (auto i : dp) {
    if (i.first == A)
      res += i.second;
    else {
      long long second = A / i.first - 1;
      if (second >= N && MillerRabin::isprime(second)) res += i.second;
    }
  }
  cout << res << endl;
  return 0;
}
