#include <bits/stdc++.h>
using namespace std;
using u128 = __int128_t;
const int N = 1e6 + 11;
const long long oo = 1e17 + 11;
const long long mod = 1000000000000159;
const long long base = 91456811863;
int tcases = 1;
int n;
namespace MillerRabinTest {
vector<long long> smallPrime, witness;
int P[N];
void init() {
  for (int i = 2; i < N; ++i) P[i] = 1;
  for (int i = 2; i <= sqrt(N); ++i) {
    if (P[i]) {
      for (int j = i * i; j < N; j += i) P[j] = 0;
    }
  }
  for (int i = 1; i <= 17; ++i)
    if (P[i]) {
      smallPrime.push_back(i);
      witness.push_back(i);
    }
}
pair<long long, long long> factor(long long n) {
  long long m = 0;
  while (!(n & 1)) {
    ++m;
    n >>= 1;
  }
  return make_pair(m, n);
}
long long modpower(long long x, long long y, long long n) {
  long long rr = 1;
  while (y) {
    if (y & 1) rr = (u128)rr * x % n;
    x = (u128)x * x % n;
    y >>= 1;
  }
  return rr;
}
bool check(long long n, long long s, long long d, long long a) {
  long long x = modpower(a, d, n);
  if (x == 1) return 1;
  for (; s > 0; --s) {
    if (x == n - 1) return 1;
    x = (u128)x * x % n;
  }
  return 0;
}
bool miller(long long x) {
  if (x < N) return P[x];
  for (long long p : smallPrime) {
    if (x % p == 0) return 0;
  }
  pair<long long, long long> ft = factor(x - 1);
  for (long long a : witness)
    if (!check(x, ft.first, ft.second, a)) return 0;
  return 1;
}
};  // namespace MillerRabinTest
long long A;
vector<long long> divs;
vector<pair<long long, int> > f[6789];
vector<int> dlist[6789];
int res = 0;
unordered_map<long long, int> dmap, S;
long long primeList[123];
int m = 1;
long long getHash(long long x, long long p, int h) {
  return ((u128)x * p * base + (u128)p * h * 31122002 * (x + p * 123 + h)) %
         mod;
}
void bf(long long cur = 1, long long curHash = 0) {
  if (cur >= A) {
    if (!S[curHash]) {
      ++res;
      S[curHash] = 1;
    }
    return;
  }
  long long x = A / cur;
  int i = dmap[x];
  for (int k = dlist[i].size() - 1; k >= 0; --k) {
    int j = dlist[i][k];
    if (divs[j] <= primeList[m]) return;
    long long d = divs[j];
    for (auto pp : f[j]) {
      long long p = pp.first;
      if (p > primeList[m]) {
        primeList[++m] = p;
        bf(cur * d, getHash(curHash, p, pp.second));
        --m;
      }
    }
  }
}
long long getS(long long x, int j) {
  long long a = exp(log(x) / j);
  for (int v = 1; v >= -1; --v) {
    long long b = a + v;
    long long y = 1;
    for (int k = 1; k <= j; ++k) y *= b;
    if (y == x) return b;
  }
  return -1;
}
void testcase() {
  cin >> A;
  if (A <= 1) {
    cout << 1;
    return;
  }
  MillerRabinTest::init();
  for (long long i = 1; i * i <= A; ++i) {
    if (A % i == 0) {
      divs.push_back(i);
      if (A / i != i) divs.push_back(A / i);
    }
  }
  sort((divs).begin(), (divs).end());
  for (int i = 0; i < divs.size(); ++i) {
    dmap[divs[i]] = i;
    for (int j = 1; j <= i; ++j)
      if (divs[i] % divs[j] == 0) {
        dlist[i].push_back(j);
      }
  }
  for (int i = 0; i < divs.size(); ++i) {
    long long x = divs[i] - 1;
    if (x <= 0) continue;
    for (int j = 1; j <= 7; ++j) {
      long long a = getS(x, j);
      if (a > 0)
        if (MillerRabinTest::miller(a)) {
          f[i].push_back(make_pair(a, j));
        }
    }
    for (int j = 1; j <= 123; ++j)
      if (MillerRabinTest::miller(j)) {
        long long y = 1;
        int k = 0;
        while (y * j <= x) {
          y *= j;
          ++k;
        }
        if (y > 1 && y == x) f[i].push_back(make_pair(j, k));
      }
    sort((f[i]).begin(), (f[i]).end());
    f[i].erase(unique((f[i]).begin(), (f[i]).end()), f[i].end());
  }
  primeList[1] = 1;
  bf();
  cout << res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie();
  cout.tie();
  for (int i = 1; i <= tcases; ++i) testcase();
  cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
  return 0;
}
