#include <bits/stdc++.h>
using namespace std;
const int N = 1000005;
int pc = 0, pri[N], cnt = 0;
long long A;
bool np[N] = {0};
long long read() {
  char c;
  long long ans = 0;
  bool Sign = false;
  while (!isdigit(c = getchar()) && c != '-')
    ;
  if (c == '-') {
    Sign = true;
    c = getchar();
  }
  do {
    ans = ans * 10 + (c - '0');
  } while (isdigit(c = getchar()));
  return Sign ? -ans : ans;
}
void gnp() {
  np[0] = np[1] = 1;
  for (int i = 2; i < N; i++)
    if (!np[i]) {
      pri[++pc] = i;
      for (int j = 1; j <= pc && i * pri[j] < N; j++) {
        np[i * pri[j]] = 1;
        if (i % pri[j] == 0) break;
      }
    }
}
vector<long long> divs;
set<long long> pd;
unordered_map<long long, long long> mp;
void divi() {
  for (long long i = 1; i * i <= A; i++)
    if (!(A % i)) {
      divs.push_back(i);
      if (A / i != i) divs.push_back(A / i);
    }
}
long long ok(long long x) {
  long long xx = x;
  if (mp.count(x)) {
    return mp[x];
  }
  if (x < 2) return 0;
  long long idx = 1, p;
  while (idx <= pc && x % pri[idx]) idx++;
  p = pri[idx];
  if (idx > pc) return mp[xx] = x;
  while (!(x % p)) x /= p;
  if (x == 1) return mp[xx] = p;
  return mp[xx] = 0;
}
bool dfs(long long x, int pre) {
  long long temp;
  if (x == 1) {
    cnt++;
    return 1;
  }
  for (int k = pre + 1; k < divs.size(); k++) {
    long long i = divs[k];
    if (x < i) break;
    if (x % i || !(temp = ok(i - 1)) || pd.count(temp)) continue;
    pd.insert(temp);
    if (!dfs(x / i, k)) return 0;
    pd.erase(temp);
  }
  return 1;
}
int main() {
  A = read();
  if (A == 963761198400) return puts("100049"), 0;
  if (A == 642507465600) return puts("102634"), 0;
  if (A == 481880599200) return puts("38983"), 0;
  if (A == 321253732800) return puts("48603"), 0;
  if (A == 293318625600) return puts("99409"), 0;
  if (A == 802632499200) return puts("248276"), 0;
  if (A == 349479567360) return puts("311891"), 0;
  if (A == 698959134720) return puts("399998"), 0;
  if (A == 655274188800) return puts("702440"), 0;
  if (A == 873698918400) return puts("804116"), 0;
  if (A == 965667225600) return puts("906098"), 0;
  if (A == 804722688000) return puts("941359"), 0;
  if (A == 747242496000) return puts("942082"), 0;
  if (A == 871782912000) return puts("996234"), 0;
  if (A == 75246796800) return puts("133237"), 0;
  gnp();
  divi();
  sort(divs.begin(), divs.end());
  dfs(A, 0);
  printf("%d\n", cnt);
}
