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>
const int bestfy[1001] = {
    0,  1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 2,  0, 1, 0, 0, 1, 2, 0, 2, 0, 0, 0,
    3,  0, 1, 0, 1, 0, 3, 0, 2, 1, 0, 0, 2,  0, 1, 0, 1, 0, 2, 0, 1, 0, 0, 0,
    3,  0, 2, 0, 0, 0, 3, 0, 1, 0, 0, 0, 4,  0, 1, 0, 0, 1, 0, 0, 2, 0, 1, 0,
    6,  0, 1, 0, 0, 0, 1, 0, 3, 0, 1, 0, 3,  0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0,
    4,  0, 1, 0, 1, 0, 2, 0, 2, 0, 0, 0, 3,  0, 1, 0, 1, 0, 2, 0, 0, 0, 0, 0,
    5,  0, 1, 0, 0, 0, 3, 0, 2, 1, 1, 0, 3,  0, 0, 0, 1, 0, 1, 0, 3, 0, 0, 0,
    5,  0, 0, 0, 0, 0, 3,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1, 0, 0, 0, 2,  0, 1, 0, 3, 0, 1, 0, 0, 0, 0, 0,
    12, 0, 1, 0, 0, 0, 1, 0, 1, 0, 2, 0, 1,  0, 1, 0, 0, 0, 2, 0, 1, 0, 0, 0,
    12, 0, 0, 0, 1, 0, 2, 0, 0, 0, 0, 0, 0,  0, 1, 0, 3, 0, 3, 0, 1, 0, 0, 0,
    3,  0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 8,  0, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0,
    7,  0, 0, 0, 0, 0, 2, 0, 2, 0, 0, 0, 2,  0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
    5,  0, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 2,  0, 0, 0, 2, 0, 2, 0, 0, 0, 0, 0,
    15, 0, 1, 0, 0, 0, 0, 0, 2, 0, 1, 0, 5,  0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0,
    3,  0, 0, 0, 1, 0, 3, 0, 1, 0, 0, 0, 1,  0, 1, 0, 4};
namespace NT {
int pn = 0, c[1000054], p[80000];
int cnt = 0;
std::pair<long long, int> fac[50];
long long Power(long long a, int n, long long c = 1) {
  for (; n; n >>= 1, a *= a)
    if (n & 1) c *= a;
  return c;
}
inline long long MulMod(long long a, long long b, long long m) {
  long long t = (a * b - (long long)((long double)a * b / m) * m) % m;
  return t + (t >> 63 & m);
}
long long PowerMod(long long a, long long n, long long m) {
  if (!n) return 1ll;
  long long s = PowerMod(a, n >> 1, m);
  s = MulMod(s, s, m);
  return n & 1 ? MulMod(s, a, m) : s;
}
void sieve(int n) {
  int i, j, v;
  for (i = 2; i <= n; ++i) {
    if (!c[i]) p[pn++] = i;
    for (j = 0; j < pn && (v = i * p[j]) <= n; ++j)
      if (c[v] = p[j], !(i % p[j])) break;
  }
}
inline void push(long long prime, int alpha) {
  fac[cnt++] = std::pair<long long, int>(prime, alpha);
}
void Factor(long long n) {
  int i, j;
  cnt = 0;
  for (i = 0; n > 1;)
    if (n >= 1000054) {
      for (j = 0; i < pn && (long long)p[i] * p[i] <= n; ++i)
        if (!(n % p[i])) {
          for (; !(n % p[i]); n /= p[i], ++j)
            ;
          push(p[i], j);
          break;
        }
      if (!j) {
        push(n, 1);
        return;
      }
    } else {
      i = c[n] ? c[n] : n;
      for (j = 0; !(n % i); n /= i, ++j)
        ;
      push(i, j);
    }
}
const int test[8] = {2, 3, 5, 7, 11, 13, 82, 373};
bool Miller_Rabin(long long n) {
  if (n < 1000054) return !c[n] && n > 1;
  int c, i, j;
  long long s = n - 1, u, v;
  for (c = 0; !(s & 1); ++c, s >>= 1)
    ;
  for (i = 0; i < 8; ++i) {
    if (!(n % test[i])) return false;
    u = PowerMod(test[i], s, n);
    for (j = 0; j < c; ++j, u = v)
      if (v = MulMod(u, u, n), u != 1 && u != n - 1 && v == 1) return false;
    if (u != 1) return false;
  }
  return true;
}
long long property(long long n) {
  if (n <= 1) return 0;
  int i;
  long long x;
  if (n < 1000054) {
    for (i = c[n] ? c[n] : n; !(n % i); n /= i)
      ;
    return n == 1 ? i : 0;
  }
  for (i = 0; i < 25; ++i)
    if (!(n % p[i])) {
      for (; !(n % p[i]); n /= p[i])
        ;
      return n == 1 ? p[i] : 0;
    }
  for (i = 1; i <= 6; ++i) {
    for (x = powl(n, 1.0L / (long double)i) - 1; Power(x, i) < n; ++x)
      ;
    if (Power(x, i) != n) continue;
    if (Miller_Rabin(x)) return x;
  }
  return 0;
}
}  // namespace NT
using NT::fac;
long long n;
long long dv[7000], pcp[7000], dp[7000][1 << 12];
int m, Pcp, ppt[7000], pcp_ppt[7000], fy_pos[7000];
std::map<long long, int> PS;
void dfs(int dep, long long cur) {
  if (dep == NT::cnt) {
    dv[m++] = cur;
    return;
  }
  for (int i = 0; i <= fac[dep].second; ++i, cur *= fac[dep].first)
    dfs(dep + 1, cur);
}
void work() {
  int i, j, k, l, g;
  long long r;
  std::map<long long, int>::iterator it;
  scanf("%lld", &n);
  Pcp = m = 0;
  if (n <= 1000) {
    printf("%d\n", bestfy[n]);
    return;
  }
  NT::Factor(n);
  dfs(0, 1);
  std::sort(dv, dv + m);
  PS.clear();
  for (i = 0; i < m; ++i)
    if (ppt[i] = NT::property(dv[i] - 1)) {
      if (it = PS.find(ppt[i]), it == PS.end())
        PS.insert(std::pair<long long, int>(ppt[i], -1));
      else if (it->second == -1)
        pcp[Pcp] = ppt[i], it->second = Pcp++;
    }
  assert(Pcp <= 12);
  for (i = 0; i < m; ++i) pcp_ppt[i] = (ppt[i] ? PS[ppt[i]] : -1);
  memset(dp, 0, m << 15);
  dp[0][0] = 1;
  for (i = 1; i < m; ++i)
    if (ppt[i]) {
      r = n / dv[i];
      g = pcp_ppt[i];
      for (k = 0; k < m - i; ++k)
        fy_pos[k] =
            (r % dv[k] ? -1 : std::lower_bound(dv, dv + m, dv[i] * dv[k]) - dv);
      for (k = m - i - 1; k >= 0; --k)
        if (~(l = fy_pos[k]))
          for (j = ~(-1 << Pcp); j >= 0; --j)
            if (dp[k][j]) {
              if (~g)
                j >> g & 1 ? 0 : dp[l][j | 1 << g] += dp[k][j];
              else
                dp[l][j] += dp[k][j];
            }
    }
  for (r = j = 0; j < 1 << Pcp; ++j) r += dp[m - 1][j];
  printf("%lld\n", r);
}
int main() {
  NT::sieve(1000054 - 1);
  work();
  return 0;
}