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 = 10005;
map<long long, long long> mm;
long long a[maxn << 1];
vector<long long> g[20005];
map<long long, int> ss;
int s1;
int tot;
const int S = 20;
long long mult_mod(long long a, long long b, long long c) {
  a %= c;
  b %= c;
  long long ret = 0;
  while (b) {
    if (b & 1) {
      ret += a;
      ret %= c;
    }
    a <<= 1;
    if (a >= c) a %= c;
    b >>= 1;
  }
  return ret;
}
long long pow_mod(long long x, long long n, long long mod) {
  if (n == 1) return x % mod;
  x %= mod;
  long long tmp = x;
  long long ret = 1;
  while (n) {
    if (n & 1) ret = mult_mod(ret, tmp, mod);
    tmp = mult_mod(tmp, tmp, mod);
    n >>= 1;
  }
  return ret;
}
bool check(long long a, long long n, long long x, long long t) {
  long long ret = pow_mod(a, x, n);
  long long last = ret;
  for (int i = 1; i <= t; i++) {
    ret = mult_mod(ret, ret, n);
    if (ret == 1 && last != 1 && last != n - 1) return true;
    last = ret;
  }
  if (ret != 1) return true;
  return false;
}
bool Miller_Rabin(long long n) {
  if (n < 2) return false;
  if (n == 2) return true;
  if ((n & 1) == 0) return false;
  long long x = n - 1;
  long long t = 0;
  while ((x & 1) == 0) {
    x >>= 1;
    t++;
  }
  for (int i = 0; i < S; i++) {
    long long a = rand() % (n - 1) + 1;
    if (check(a, n, x, t)) return false;
  }
  return true;
}
long long factor[100];
int tol;
long long gcd(long long a, long long b) {
  if (a == 0) return 1;
  if (a < 0) return gcd(-a, b);
  while (b) {
    long long t = a % b;
    a = b;
    b = t;
  }
  return a;
}
long long Pollard_rho(long long x, long long c) {
  long long i = 1, k = 2;
  long long x0 = rand() % x;
  long long y = x0;
  while (1) {
    i++;
    x0 = (mult_mod(x0, x0, x) + c) % x;
    long long d = gcd(y - x0, x);
    if (d != 1 && d != x) return d;
    if (y == x0) return x;
    if (i == k) {
      y = x0;
      k += k;
    }
  }
}
void findfac(long long n) {
  if (Miller_Rabin(n)) {
    factor[tol++] = n;
    return;
  }
  long long p = n;
  while (p >= n) p = Pollard_rho(p, rand() % (n - 1) + 1);
  findfac(p);
  findfac(n / p);
}
long long prim[maxn];
int cnt;
int main() {
  long long n;
  cin >> n;
  if (n == 1) {
    printf("1\n");
    return 0;
  }
  if (n == 2) {
    printf("0\n");
    return 0;
  }
  a[tot++] = n;
  for (long long i = 2; i * i <= n; i++) {
    if (n % i == 0) {
      a[tot++] = i;
      if (i * i != n) a[tot++] = n / i;
    }
  }
  sort(a, a + tot);
  s1 = 1;
  for (int i = 0; i < tot; i++) {
    if (a[i] > 2) {
      tol = 0;
      findfac(a[i] - 1);
      int f = 0;
      for (int j = 1; j < tol; j++) {
        if (factor[j] != factor[0]) {
          f = 1;
          break;
        }
      }
      if (!f) {
        int p = ss[factor[0]];
        if (p) {
          g[p].push_back(a[i]);
        } else {
          ss[factor[0]] = s1;
          s1++;
          g[s1 - 1].push_back(a[i]);
        }
      }
    }
  }
  mm[1] = 1;
  for (int j = 1; j <= s1; j++) {
    for (int i = tot - 1; i >= 0; i--) {
      for (int f = 0; f < g[j].size(); f++) {
        if (a[i] % g[j][f] == 0) {
          mm[a[i]] += mm[a[i] / g[j][f]];
        }
      }
    }
  }
  cout << mm[n] << endl;
}