Problem: It's tough to be a superhero. And it's twice as tough to resist the supervillain who is cool at math. Suppose that you're an ordinary Batman in an ordinary city of Gotham. Your enemy Joker mined the building of the city administration and you only have several minutes to neutralize the charge. To do that you should enter the cancel code on the bomb control panel.

However, that mad man decided to give you a hint. This morning the mayor found a playing card under his pillow. There was a line written on the card:

<image>

The bomb has a note saying "J(x) = A", where A is some positive integer. You suspect that the cancel code is some integer x that meets the equation J(x) = A. Now in order to decide whether you should neutralize the bomb or run for your life, you've got to count how many distinct positive integers x meet this equation.

Input

The single line of the input contains a single integer A (1 ≤ A ≤ 1012).

Output

Print the number of solutions of the equation J(x) = A.

Examples

Input

3


Output

1


Input

24


Output

3

Note

Record x|n means that number n divides number x.

<image> is defined as the largest positive integer that divides both a and b.

In the first sample test the only suitable value of x is 2. Then J(2) = 1 + 2.

In the second sample test the following values of x match:

  * x = 14, J(14) = 1 + 2 + 7 + 14 = 24
  * x = 15, J(15) = 1 + 3 + 5 + 15 = 24
  * x = 23, J(23) = 1 + 23 = 24

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
namespace Factor {
const int CNT_SMALL_PRIMES = 12;
const int SMALL_PRIMES[CNT_SMALL_PRIMES] = {2,  3,  5,  7,  11, 13,
                                            17, 19, 23, 29, 31, 37};
std::mt19937_64 random_gen(
    std::chrono::steady_clock::now().time_since_epoch().count());
inline long long gcd(long long a, long long b) {
  if (b == 0) return a;
  int shift = __builtin_ctzll(a | b);
  b >>= __builtin_ctzll(b);
  while (a) {
    a >>= __builtin_ctzll(a);
    if (a < b) std::swap(a, b);
    a -= b;
  }
  return b << shift;
}
inline long long abs(long long a) { return a < 0 ? -a : a; }
inline long long mul_mod(long long a, long long b, long long mod) {
  return __int128(a) * b % mod;
}
inline long long pw(long long a, long long to, long long mod) {
  long long res = 1;
  while (to) {
    if (to & 1) res = mul_mod(res, a, mod);
    a = mul_mod(a, a, mod);
    to >>= 1;
  }
  return res;
}
inline bool miller_rabin(long long n, long long a) {
  a %= n;
  if (a < 2 || a == n - 1) return false;
  int shift = __builtin_ctzll(n - 1);
  long long t = (n - 1) >> shift;
  long long kek = pw(a, t, n);
  if (kek == 1) return false;
  if (kek == n - 1) return false;
  for (int i = 1; i < shift; i++) {
    kek = mul_mod(kek, kek, n);
    if (kek == 1) return true;
    if (kek == n - 1) return false;
  }
  return true;
}
inline bool test_prime(long long n) {
  if (n == 1) return false;
  for (int i = 0; i < CNT_SMALL_PRIMES && SMALL_PRIMES[i] < n; i++) {
    if (miller_rabin(n, SMALL_PRIMES[i])) return false;
  }
  return true;
}
inline long long G(long long x, long long mod) {
  x = mul_mod(x, x, mod);
  ++x;
  x -= x == mod ? mod : 0;
  return x;
}
inline void factorize(long long n, std::vector<long long>& p) {
  if (n == 1) return;
  if (test_prime(n)) {
    p.push_back(n);
    return;
  }
  for (int i = 0; i < CNT_SMALL_PRIMES; i++) {
    if (n % SMALL_PRIMES[i] == 0) {
      p.push_back(SMALL_PRIMES[i]);
      factorize(n / SMALL_PRIMES[i], p);
      return;
    }
  }
  while (true) {
    long long x = random_gen() % (n - 1) + 1;
    long long y = G(x, n);
    int a = 1, b = 2;
    while (true) {
      long long d = x - y;
      d += d < 0 ? n : 0;
      if (!d) break;
      long long g = gcd(d, n);
      if (g != 1) {
        factorize(g, p);
        factorize(n / g, p);
        return;
      }
      if (a * 2 == b) {
        a *= 2;
        x = y;
      }
      ++b;
      y = G(y, n);
    }
  }
}
}  // namespace Factor
const int N = (int)1e6 + 6;
int dp[N];
int old[N];
long long n;
long long divs[N];
long long p[N];
long long big[N];
long long idx[N];
vector<pair<long long, long long> > tran;
int sz = 0;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  for (long long i = 1; i * i <= n; i++) {
    if (n % i) continue;
    divs[sz++] = i;
    if (i * i != n) divs[sz++] = n / i;
  }
  sort(divs, divs + sz);
  for (int i = 0; i < sz; i++) {
    if (divs[i] < N)
      idx[divs[i]] = i;
    else
      big[n / divs[i]] = i;
    if (divs[i] - 1 <= 1) continue;
    vector<long long> tmp;
    Factor::factorize(divs[i] - 1, tmp);
    if (unique((tmp).begin(), (tmp).end()) != tmp.begin() + 1) continue;
    tran.emplace_back(tmp[0], divs[i]);
  }
  sort((tran).begin(), (tran).end());
  old[0] = 1;
  size_t ptr = 0;
  while (ptr < tran.size()) {
    size_t j = ptr;
    memcpy(dp, old, sz * sizeof(dp[0]));
    while (j < tran.size() && tran[j].first == tran[ptr].first) {
      long long div = tran[j].second;
      for (int i = 0; i < sz; i++) {
        if (divs[i] % div) continue;
        long long prv = divs[i] / div;
        int k = prv < N ? idx[prv] : big[n / prv];
        dp[i] += old[k];
      }
      ++j;
    }
    memcpy(old, dp, sz * sizeof(dp[0]));
    ptr = j;
  }
  cout << old[n < N ? idx[n] : big[1]] << endl;
  return 0;
}