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;
const int MAXN = 1e6 + 5;
char buf[1 << 12], *pp1 = buf, *pp2 = buf, nc;
int ny;
inline char gc() {
  return pp1 == pp2 &&
                 (pp2 = (pp1 = buf) + fread(buf, 1, 1 << 12, stdin), pp1 == pp2)
             ? EOF
             : *pp1++;
}
inline long long read() {
  long long x = 0;
  for (ny = 1; nc = gc(), (nc < 48 || nc > 57) && nc != EOF;)
    if (nc == 45) ny = -1;
  if (nc < 0) return nc;
  for (x = nc - 48; nc = gc(), 47 < nc && nc < 58 && nc != EOF;
       x = (x << 3) + (x << 1) + (nc ^ 48))
    ;
  return x * ny;
}
long long A, p[MAXN];
int lim, N, tot;
struct Node {
  long long a[MAXN], b[MAXN];
  inline long long& operator[](long long x) {
    return x <= lim ? a[x] : b[A / x];
  }
} vis, id;
inline int Mysqrt(long long x) {
  int y = sqrt(x);
  for (; 1ll * y * y > x; y--)
    ;
  for (; 1ll * (y + 1) * (y + 1) <= x; y++)
    ;
  return y;
}
int v[MAXN], pri[MAXN], cnt;
long long pp[MAXN];
inline void Init(int n = 1e6) {
  for (int i = (2); i <= (n); i++) {
    if (!v[i]) {
      pri[++cnt] = i;
      for (long long t = 1ll * i * i; t <= A; t *= i)
        if (A % (t + 1) == 0) vis[t + 1] = i;
    }
    for (int j = 1; j <= cnt && i * pri[j] <= n; j++) {
      v[i * pri[j]] = 1;
      if (i % pri[j] == 0) break;
    }
  }
}
inline long long Abs(long long x) { return x < 0 ? -x : x; }
inline long long gcd(long long x, long long y) {
  for (long long z; y; z = x, x = y, y = z % y)
    ;
  return x;
}
inline long long Fm(long long a, long long b, long long Mod) {
  a %= Mod, b %= Mod;
  return (a * b - (unsigned long long)((long double)a / Mod * b) * Mod + Mod) %
         Mod;
}
inline long long Fp(long long x, long long k, long long Mod) {
  long long ans = 1;
  for (; k; k >>= 1, x = Fm(x, x, Mod))
    if (k & 1) ans = Fm(ans, x, Mod);
  return ans;
}
int kx[5] = {2, 3, 5, 7, 43};
inline bool Mr(long long a, long long n) {
  if (Fp(a, n - 1, n) != 1) return 0;
  for (long long y = n - 1, z; !(y & 1);) {
    y >>= 1, z = Fp(a, y, n);
    if (z != 1 && z != n - 1) return 0;
    if (z == n - 1) return 1;
  }
  return 1;
}
inline bool chk(long long n) {
  if (n < 2) return 0;
  if (n == 2 || n == 3 || n == 5 || n == 7 || n == 43) return 1;
  return Mr(2, n) && Mr(3, n) && Mr(5, n) && Mr(7, n) && Mr(43, n);
}
vector<long long> S[MAXN];
long long f[MAXN], g[MAXN];
int main() {
  A = read(), lim = Mysqrt(A);
  for (int i = (1); i <= (lim); i++)
    if (A % i == 0) p[++N] = i, 1ll * i * i != A ? p[++N] = A / i : 0;
  sort(p + 1, p + N + 1);
  for (int i = (1); i <= (N); i++) id[p[i]] = i;
  for (int i = (2); i <= (N); i++)
    if (chk(p[i] - 1)) vis[p[i]] = p[i] - 1;
  Init();
  for (int i = (1); i <= (N); i++)
    if (vis[p[i]]) pp[++tot] = vis[p[i]];
  sort(pp + 1, pp + tot + 1), tot = unique(pp + 1, pp + tot + 1) - pp - 1;
  for (int i = (1); i <= (N); i++)
    if (vis[p[i]]) {
      int t = lower_bound(pp + 1, pp + tot + 1, vis[p[i]]) - pp;
      S[t].push_back(p[i]);
    }
  g[1] = f[1] = 1;
  for (int i = (1); i <= (tot); i++) {
    for (int j = (id[A / S[i][0]]); j >= (1); j--)
      for (auto o : S[i])
        if (o * p[j] > A)
          break;
        else if (A % (o * p[j]) == 0)
          g[id[o * p[j]]] += f[j];
    for (int j = (1); j <= (N); j++) f[j] = g[j];
  }
  cout << f[N] << "\n";
  return 0;
}