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;
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;
}