#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1000001;
bool isprime[MAXN];
vector<long long> primes;
bool check_prime(long long n) {
  if (n < 2) return false;
  if (n < MAXN) return !isprime[n];
  for (int x : primes) {
    long long x2 = x * 1ll * x;
    if (x2 > n) break;
    if (n % x == 0) return false;
  }
  return true;
}
long long power(long long x, int pw, long long up) {
  long long r = 1;
  while (pw--) {
    r *= x;
    if (r > up) return r;
  }
  return r;
}
bool primepower(long long x, long long& base) {
  if (x <= 1) return false;
  if (check_prime(x)) {
    base = x;
    return true;
  }
  for (long long pw = 40; pw >= 2; --pw) {
    long long l = 0, r = 1000001;
    while (r - l > 1) {
      long long m = (l + r) / 2;
      if (power(m, pw, x) > x)
        r = m;
      else
        l = m;
    }
    if (power(l, pw, x) == x) {
      if (check_prime(l)) {
        base = l;
        return true;
      }
      return false;
    }
  }
  return false;
}
void init_primes() {
  for (long long i = 2; i * i < MAXN; ++i)
    if (!isprime[i])
      for (long long j = i * i; j < MAXN; j += i) isprime[j] = true;
  for (int i = (int)(2); i <= (int)(MAXN - 1); ++i)
    if (!isprime[i]) primes.push_back(i);
}
long long solve(long long A) {
  vector<long long> d;
  for (long long i = 1; i * i <= A; ++i)
    if (A % i == 0) {
      d.push_back(i);
      if (i * i < A) d.push_back(A / i);
    }
  sort((d).begin(), (d).end());
  map<long long, vector<long long> > gd;
  for (long long x : d) {
    long long bs = 1;
    if (x == 1 || primepower(x - 1, bs)) {
      gd[bs].push_back(x);
    }
  }
  vector<vector<long long> > ans(gd.size(), vector<long long>(d.size(), 0));
  ans[0][0] = 1;
  int t = 1;
  for (auto& e : gd)
    if (e.first > 1) {
      for (long long good : e.second) {
        int j = 0;
        for (int i = 0; i < (int)(d.size()); ++i) {
          while (j < d.size() && d[j] / good < d[i]) ++j;
          if (j < d.size() && d[j] / good == d[i] && d[j] % good == 0)
            ans[t][j] += ans[t - 1][i];
        }
      }
      for (int i = 0; i < (int)(d.size()); ++i) ans[t][i] += ans[t - 1][i];
      ++t;
    }
  return ans[gd.size() - 1][d.size() - 1];
}
int main() {
  init_primes();
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout << fixed;
  cout.precision(15);
  cerr << fixed;
  cerr.precision(15);
  long long A;
  cin >> A;
  cout << solve(A) << '\n';
  return 0;
}
