#include <bits/stdc++.h>
using namespace std;
const int mxn = 1e6 + 10;
const int mxp = 78499 + 10;
const int mxd = 1e4;
bool pri[mxn];
int ps[mxp], np = 0;
long long int pa[mxn];
int npa = 0;
int dix[mxn << 1];
long long int dvs[mxd];
long long int f[2][mxd];
void check(long long int x) {
  if (x == 0) return;
  int nf = 0;
  long long int lp = -1;
  for (int i = 0; i < np && ps[i] * ps[i] <= x; i++) {
    long long int p = ps[i];
    if (x % p == 0) {
      lp = p;
      nf++;
    }
    while (x % p == 0) x /= p;
    if (nf > 1) break;
  }
  if (x != 1) {
    nf++;
    lp = x;
  }
  if (nf == 1) pa[npa++] = lp;
}
int main() {
  memset(pri, true, sizeof pri);
  pri[0] = pri[1] = false;
  for (int i = 2; i < mxn; i++) {
    if (pri[i]) {
      ps[np++] = i;
      if (np >= mxp) break;
      for (int j = i + i; j < mxn; j += i) pri[j] = false;
    }
  }
  long long int a;
  cin >> a;
  int nd = 0;
  for (long long int x = 1; x * x <= a; x++) {
    if (a % x == 0) {
      dvs[nd++] = x;
      check(x - 1);
      long long int y = a / x;
      if (y != x) {
        dvs[nd++] = y;
        check(y - 1);
      }
    }
  }
  sort(pa, pa + npa);
  npa = unique(pa, pa + npa) - pa;
  long long int sq = sqrtl(a);
  sort(dvs, dvs + nd);
  for (int i = 0; i < nd; i++) {
    if (dvs[i] <= sq)
      dix[dvs[i]] = i;
    else
      dix[mxn + a / dvs[i]] = i;
  }
  memset(f, 0, sizeof f);
  f[0][0] = 1;
  int rw = 1;
  for (int i = npa - 1; i >= 0; i--) {
    for (int dd = 0; dd < nd; dd++) {
      f[rw][dd] = f[rw ^ 1][dd];
      long long int d = dvs[dd];
      long long int pe = pa[i];
      for (int e = 1; pe + 1 <= d; e++) {
        if (d % (1ll + pe) == 0) {
          long long int dn = d / (pe + 1ll);
          int pos = dn;
          if (dn > sq) pos = mxn + a / dn;
          int dx = dix[pos];
          f[rw][dd] += f[rw ^ 1][dx];
        }
        pe *= pa[i];
      }
    }
    rw ^= 1;
  }
  cout << f[rw ^ 1][nd - 1] << endl;
  return 0;
}
