#include <bits/stdc++.h>
using namespace std;
long long A;
long long sieve[1001001];
vector<long long> allp;
vector<long long> facs;
vector<pair<long long, long long> > ppf;
void do_sieve() {
  sieve[1] = -1;
  for (long long v = 2; v <= 1000000; v++)
    if (sieve[v])
      continue;
    else {
      allp.push_back(v);
      for (long long w = v; w <= 1000000; w += v) sieve[w] = v;
    }
}
pair<int, int> prim_pow(long long arg) {
  if (arg <= 1) return make_pair(0, 0);
  for (int i = 0; i < allp.size(); i++) {
    if (arg % allp[i]) continue;
    int ct = 0;
    while (arg % allp[i] == 0) {
      ct++;
      arg /= allp[i];
    }
    if (arg > 1) return make_pair(0, 0);
    return make_pair(allp[i], ct);
  }
  allp.push_back(arg);
  return make_pair(arg, 1);
}
void comp() {
  for (long long p = 1; p * p <= A; p++) {
    if (A % p) continue;
    facs.push_back(p);
    if (p * p != A) facs.push_back(A / p);
  }
  sort(facs.begin(), facs.end());
  ppf.push_back(make_pair(0, 0));
  for (int i = 1; i < facs.size(); i++) ppf.push_back(prim_pow(facs[i] - 1));
}
int idx(long long v) {
  return lower_bound(facs.begin(), facs.end(), v) - facs.begin();
}
long long ways[2][7000];
int main() {
  cin >> A;
  do_sieve();
  comp();
  sort(allp.begin(), allp.end());
  allp.resize(unique(allp.begin(), allp.end()) - allp.begin());
  vector<pair<long long, int> > sbyp;
  for (int i = 0; i < facs.size(); i++)
    if (ppf[i].second != 0) sbyp.emplace_back(ppf[i].first, i);
  sort(sbyp.begin(), sbyp.end());
  int x = 0;
  ways[0][0] = 1;
  for (int j = 0; j < sbyp.size(); j++) {
    if (j == 0 || sbyp[j].first != sbyp[j - 1].first) {
      x ^= 1;
      for (int i = 0; i < facs.size(); i++) ways[x][i] = ways[x ^ 1][i];
    }
    for (int i = 1; i < facs.size(); i++) {
      if (facs[i] % facs[sbyp[j].second] == 0)
        ways[x][i] += ways[x ^ 1][idx(facs[i] / facs[sbyp[j].second])];
    }
  }
  cout << ways[x][facs.size() - 1] << endl;
}
