#include <bits/stdc++.h>
using namespace std;
unordered_map<long long, long long> dp;
bool p[1111111];
bool is(long long N) {
  if (N < 2) return false;
  for (long long i = 2; i * i <= N; ++i) {
    if (N % i == 0) {
      return false;
    }
  }
  return true;
}
long long DP(long long N, long long lastp = 1) {
  if (N == 1) return 1;
  long long H = N * 100000000000007 + lastp;
  if (dp.count(H)) return dp[H];
  long long sol = 0;
  sol = (N - 1 > lastp) && is(N - 1);
  for (long long i = lastp + 1; i * i <= N; ++i) {
    if (!p[i]) {
      long long aux = i;
      while ((aux + 1) <= N) {
        if (N % (aux + 1) == 0) sol += DP(N / (aux + 1), i);
        aux *= i;
      }
    }
  }
  return dp[H] = sol;
}
long long A, B;
int main(int argc, char *argv[]) {
  for (int i = 2; i < 1111111; ++i)
    if (!p[i])
      for (long long j = 2; i * j < 1111111; ++j) p[i * j] = true;
  cin >> A;
  cout << DP(A) << endl;
  return 0;
}
