#include <bits/stdc++.h>
using namespace std;
const long long INF = (long long)1e18;
const long long mod = (long long)1e9 + 7;
const double eps = (double)1e-9;
const double pi = acos(-1.0);
const int dx[] = {0, 0, 1, 0, -1};
const int dy[] = {0, 1, 0, -1, 0};
const int inf = (int)1e9;
const int N = 1e6 + 211, M = 1e6;
bool np[N];
set<long long> st;
map<long long, int> num;
long long A, pr[10000];
int m, dp[7000][3000];
vector<long long> v;
bool isprime(long long x) {
  if (x <= M) return !np[x];
  for (long long i = 2; i * i <= x; ++i)
    if (x % i == 0) return 0;
  return 1;
}
long long bp(long long x, long long y) {
  long long z = 1;
  while (y--) {
    if (z > INF / x) return INF;
    z *= x;
  }
  return z;
}
long long get(long long x) {
  x--;
  for (long long i = 1; i <= 40; ++i) {
    long long l = 1, r = x;
    while (l <= r) {
      long long md = (l + r) >> 1;
      if (bp(md, i) >= x)
        r = md - 1;
      else
        l = md + 1;
    }
    r++;
    if (isprime(r) && bp(r, i) == x) return r;
  }
  return 1;
}
int main() {
  cin.tie(NULL);
  cout.tie(NULL);
  ios_base::sync_with_stdio(false);
  for (int i = 4; i <= M; i += 2) np[i] = 1;
  np[1] = 1;
  for (int i = 3; i <= 1000; i += 2)
    if (!np[i]) {
      for (int j = i * i; j <= M; j += i + i) np[j] = 1;
    }
  cin >> A;
  for (long long i = 1; i * i <= A; ++i) {
    if (A % i == 0) {
      long long x = get(i);
      v.push_back(i);
      if (x > 1) st.insert(x);
      x = get(A / i);
      if (i * i != A) v.push_back(A / i);
      if (x > 1) st.insert(x);
    }
  }
  sort(v.begin(), v.end());
  for (int i = 0; i < (int)v.size(); ++i) num[v[i]] = i;
  int cnti = 0;
  for (auto i : st) {
    cnti++;
    pr[cnti] = i;
  }
  m = st.size();
  dp[0][0] = 1;
  for (int i = 0; i < (int)v.size(); ++i)
    for (int j = 0; j < m; ++j) {
      dp[i][j + 1] += dp[i][j];
      long long x = 1;
      while (true) {
        if (x > A / pr[j + 1]) break;
        x *= pr[j + 1];
        if (v[i] > A / (x + 1)) break;
        if (A % (v[i] * (x + 1)) == 0) {
          dp[num[v[i] * (x + 1)]][j + 1] += dp[i][j];
        }
      }
    }
  cout << dp[v.size() - 1][m];
  return 0;
}
