#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:102400000,102400000")
using namespace std;
const int MAXN = 1000010;
const int MOD = 1000000007;
const long long INF = 1000000000000LL;
map<long long, bool> isipad;
map<long long, long long> bp;
bool isp[MAXN];
long long p[MAXN], c = 0;
long long calc(long long px) {
  long long ret = 1, cnt = 0;
  while (ret <= INF) {
    if (ret * px <= INF) cnt++;
    ret *= px;
    if (ret + 1 <= INF) {
      isipad[ret + 1] = true;
      bp[ret + 1] = px;
    }
  }
  return cnt;
}
long long fac[MAXN * 2];
long long multi(long long a, long long b, long long m) {
  long long ret = 0;
  while (b) {
    if (b & 1) {
      ret += a;
      if (ret >= m) ret -= m;
    }
    a <<= 1;
    if (a >= m) a -= m;
    b >>= 1;
  }
  return ret;
}
long long mod(long long a, long long b, long long m) {
  if (b == 1) return a;
  long long ret = mod(a, b >> 1, m);
  long long y = multi(ret, ret, m);
  if (y == 1 && (ret != 1 && ret != m - 1)) return 0;
  if (b & 1)
    ret = multi(y, a, m);
  else
    ret = y;
  return ret;
}
bool isprime(long long n) {
  if (n < 2) return false;
  if (n % 2 == 0 || n % 3 == 0 || n % 5 == 0 || n % 7 == 0 || n % 13 == 0)
    return false;
  for (int i = 0; i < 5; i++) {
    long long t = rand() % (n - 2) + 2;
    if (mod(t, n - 1, n) != 1) return false;
  }
  return true;
}
bool ipad(long long n) {
  if (isipad[n]) return true;
  if (isprime(n - 1)) {
    bp[n] = n - 1;
    return true;
  }
  return false;
}
long long ans = 0;
map<long long, bool> coo;
void DFS(int deep, int n, long long cs, long long A) {
  if (cs > A) return;
  if (cs == A) {
    ans++;
    return;
  }
  for (int i = deep; i < n; i++) {
    if (coo[bp[fac[i]]]) continue;
    if ((double)cs * fac[i] > A + 1) break;
    coo[bp[fac[i]]] = true;
    DFS(i + 1, n, cs * fac[i], A);
    coo[bp[fac[i]]] = false;
  }
}
bool cmp(long long a, long long b) {
  long long bpa = bp[a];
  long long bpb = bp[b];
  if (bpa != bpb) return bpa < bpb;
  return a < b;
}
long long sbp[MAXN];
long long d[MAXN], cd;
long long dp[2][MAXN];
int main() {
  long long n, m, Q;
  long long i, j;
  long long T;
  int ioflag = 1;
  long long tot = 0;
  isipad.clear();
  bp.clear();
  for (i = 2; i < MAXN; i++) {
    if (isp[i] == false) {
      p[c++] = i;
      tot += calc(i);
    }
    for (j = 0; j < c && p[j] * i < MAXN; j++) {
      isp[p[j] * i] = true;
      if (i % p[j] == 0) break;
    }
  }
  map<long long, long long>::iterator iter;
  long long A;
  map<long long, bool> buck;
  while (cin >> A) {
    if (A == 1) {
      cout << "1" << endl;
      continue;
    }
    n = 0;
    for (i = 1; i * i <= A; i++) {
      if (A % i == 0) {
        if (i != 1) fac[n++] = i;
        if (i * i != A) fac[n++] = A / i;
      }
    }
    memcpy(d, fac, sizeof(long long) * (n + 2));
    cd = n;
    d[cd++] = 1;
    sort(d, d + cd);
    j = 0;
    for (i = 0; i < n; i++) {
      if (ipad(fac[i])) {
        fac[j++] = fac[i];
      }
    }
    n = j;
    sort(fac, fac + n, cmp);
    for (i = 0; i < n; i++) sbp[i] = bp[fac[i]];
    ans = 0;
    coo.clear();
    int tag = 0;
    memset(dp[0], 0, sizeof(long long) * (cd));
    dp[0][0] = 1;
    for (i = 0; i < n; i = j) {
      tag ^= 1;
      memcpy(dp[tag], dp[tag ^ 1], sizeof(long long) * cd);
      long long basebp = sbp[i];
      for (j = i; j < n && sbp[j] == basebp; j++) {
        int front = 0;
        for (int it = 0; it < cd && front < cd; it++) {
          long long tmp = fac[j] * d[it];
          while (front < cd && d[front] < tmp) front++;
          if (front < cd && d[front] == tmp) {
            dp[tag][front] += dp[tag ^ 1][it];
          }
        }
      }
    }
    cout << dp[tag][cd - 1] << endl;
  }
  ioflag = scanf("%d", &n);
  assert(ioflag != 1);
  return 0;
}

### Prompt

In Cpp, your task is to solve the following 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

### Response

```cpp
#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:102400000,102400000")
using namespace std;
const int MAXN = 1000010;
const int MOD = 1000000007;
const long long INF = 1000000000000LL;
map<long long, bool> isipad;
map<long long, long long> bp;
bool isp[MAXN];
long long p[MAXN], c = 0;
long long calc(long long px) {
  long long ret = 1, cnt = 0;
  while (ret <= INF) {
    if (ret * px <= INF) cnt++;
    ret *= px;
    if (ret + 1 <= INF) {
      isipad[ret + 1] = true;
      bp[ret + 1] = px;
    }
  }
  return cnt;
}
long long fac[MAXN * 2];
long long multi(long long a, long long b, long long m) {
  long long ret = 0;
  while (b) {
    if (b & 1) {
      ret += a;
      if (ret >= m) ret -= m;
    }
    a <<= 1;
    if (a >= m) a -= m;
    b >>= 1;
  }
  return ret;
}
long long mod(long long a, long long b, long long m) {
  if (b == 1) return a;
  long long ret = mod(a, b >> 1, m);
  long long y = multi(ret, ret, m);
  if (y == 1 && (ret != 1 && ret != m - 1)) return 0;
  if (b & 1)
    ret = multi(y, a, m);
  else
    ret = y;
  return ret;
}
bool isprime(long long n) {
  if (n < 2) return false;
  if (n % 2 == 0 || n % 3 == 0 || n % 5 == 0 || n % 7 == 0 || n % 13 == 0)
    return false;
  for (int i = 0; i < 5; i++) {
    long long t = rand() % (n - 2) + 2;
    if (mod(t, n - 1, n) != 1) return false;
  }
  return true;
}
bool ipad(long long n) {
  if (isipad[n]) return true;
  if (isprime(n - 1)) {
    bp[n] = n - 1;
    return true;
  }
  return false;
}
long long ans = 0;
map<long long, bool> coo;
void DFS(int deep, int n, long long cs, long long A) {
  if (cs > A) return;
  if (cs == A) {
    ans++;
    return;
  }
  for (int i = deep; i < n; i++) {
    if (coo[bp[fac[i]]]) continue;
    if ((double)cs * fac[i] > A + 1) break;
    coo[bp[fac[i]]] = true;
    DFS(i + 1, n, cs * fac[i], A);
    coo[bp[fac[i]]] = false;
  }
}
bool cmp(long long a, long long b) {
  long long bpa = bp[a];
  long long bpb = bp[b];
  if (bpa != bpb) return bpa < bpb;
  return a < b;
}
long long sbp[MAXN];
long long d[MAXN], cd;
long long dp[2][MAXN];
int main() {
  long long n, m, Q;
  long long i, j;
  long long T;
  int ioflag = 1;
  long long tot = 0;
  isipad.clear();
  bp.clear();
  for (i = 2; i < MAXN; i++) {
    if (isp[i] == false) {
      p[c++] = i;
      tot += calc(i);
    }
    for (j = 0; j < c && p[j] * i < MAXN; j++) {
      isp[p[j] * i] = true;
      if (i % p[j] == 0) break;
    }
  }
  map<long long, long long>::iterator iter;
  long long A;
  map<long long, bool> buck;
  while (cin >> A) {
    if (A == 1) {
      cout << "1" << endl;
      continue;
    }
    n = 0;
    for (i = 1; i * i <= A; i++) {
      if (A % i == 0) {
        if (i != 1) fac[n++] = i;
        if (i * i != A) fac[n++] = A / i;
      }
    }
    memcpy(d, fac, sizeof(long long) * (n + 2));
    cd = n;
    d[cd++] = 1;
    sort(d, d + cd);
    j = 0;
    for (i = 0; i < n; i++) {
      if (ipad(fac[i])) {
        fac[j++] = fac[i];
      }
    }
    n = j;
    sort(fac, fac + n, cmp);
    for (i = 0; i < n; i++) sbp[i] = bp[fac[i]];
    ans = 0;
    coo.clear();
    int tag = 0;
    memset(dp[0], 0, sizeof(long long) * (cd));
    dp[0][0] = 1;
    for (i = 0; i < n; i = j) {
      tag ^= 1;
      memcpy(dp[tag], dp[tag ^ 1], sizeof(long long) * cd);
      long long basebp = sbp[i];
      for (j = i; j < n && sbp[j] == basebp; j++) {
        int front = 0;
        for (int it = 0; it < cd && front < cd; it++) {
          long long tmp = fac[j] * d[it];
          while (front < cd && d[front] < tmp) front++;
          if (front < cd && d[front] == tmp) {
            dp[tag][front] += dp[tag ^ 1][it];
          }
        }
      }
    }
    cout << dp[tag][cd - 1] << endl;
  }
  ioflag = scanf("%d", &n);
  assert(ioflag != 1);
  return 0;
}

```