#include <bits/stdc++.h>
using namespace std;
#define math signed main()
#define int long long
int n, ans = 1;
void pt(int x)
{
if (n % x != 0) return;
int cnt = 0;
while (n % x == 0) cnt++, n /= x;
ans *= (cnt + 1);
}
int mulmod(int x, int n, int m)
{
int a = 0;
x %= m;
for (; n; n >>= 1, x = x * 2 % m)
if (n & 1)
(a += x) %= m;
return a;
}
int power(int x, int n, int m)
{
int a = 1;
x %= m;
for (; n; n >>= 1, x = mulmod(x, x, m))
if (n & 1) a = mulmod(a, x, m);
return a;
}
bool check(int a, int n, int m, int k)
{
int t = power(a, m, n);
if (t == 1 || t == n - 1) return false;
for (int i = 1; i < k; i++)
{
t = mulmod(t, t, n);
if (t == n - 1) return false;
}
return true;
}
bool miller(int n)
{
if (n < 2) return false;
if (n % 2 == 0 || n % 3 == 0 || n % 5 == 0 || n % 7 == 0)
return n == 2 || n == 3 || n == 5 || n == 7;
int m = n - 1, k = 0;
while ((m & 1) == 0)
m >>= 1, k++;
for (int a : {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37})
{
if (a > n - 2) break;
if (check(a, n, m, k)) return false;
}
return true;
}
math
{
cin.tie(0)->sync_with_stdio(0);
cin >> n;
if (miller(n)) return cout << 2,0;
pt(2);
pt(3);
for (int i = 5; i * i * i <= n; i += 6) {
pt(i);
pt(i + 2);
}
if (miller(n))
ans *= 2;
else {
int a = sqrt(n);
if (a * a == n && miller(a))
ans *= 3;
else
ans *= 4;
}
cout << ans << "\n";
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CiNkZWZpbmUgbWF0aCBzaWduZWQgbWFpbigpCiNkZWZpbmUgaW50IGxvbmcgbG9uZwppbnQgbiwgYW5zID0gMTsKCnZvaWQgcHQoaW50IHgpCnsKICAgIGlmIChuICUgeCAhPSAwKSByZXR1cm47CiAgICBpbnQgY250ID0gMDsKICAgIHdoaWxlIChuICUgeCA9PSAwKSBjbnQrKywgbiAvPSB4OwogICAgYW5zICo9IChjbnQgKyAxKTsKfQoKaW50IG11bG1vZChpbnQgeCwgaW50IG4sIGludCBtKQp7CiAgICBpbnQgYSA9IDA7CiAgICB4ICU9IG07CiAgICBmb3IgKDsgbjsgbiA+Pj0gMSwgeCA9IHggKiAyICUgbSkKICAgICAgICBpZiAobiAmIDEpCiAgICAgICAgICAgIChhICs9IHgpICU9IG07CiAgICByZXR1cm4gYTsKfQppbnQgcG93ZXIoaW50IHgsIGludCBuLCBpbnQgbSkKewogICAgaW50IGEgPSAxOwogICAgeCAlPSBtOwogICAgZm9yICg7IG47IG4gPj49IDEsIHggPSBtdWxtb2QoeCwgeCwgbSkpCiAgICBpZiAobiAmIDEpIGEgPSBtdWxtb2QoYSwgeCwgbSk7CiAgICByZXR1cm4gYTsKfQpib29sIGNoZWNrKGludCBhLCBpbnQgbiwgaW50IG0sIGludCBrKQp7CiAgICBpbnQgdCA9IHBvd2VyKGEsIG0sIG4pOwogICAgaWYgKHQgPT0gMSB8fCB0ID09IG4gLSAxKSByZXR1cm4gZmFsc2U7CiAgICBmb3IgKGludCBpID0gMTsgaSA8IGs7IGkrKykKICAgIHsKICAgICAgICB0ID0gbXVsbW9kKHQsIHQsIG4pOwogICAgICAgIGlmICh0ID09IG4gLSAxKSByZXR1cm4gZmFsc2U7CiAgICB9CiAgICByZXR1cm4gdHJ1ZTsKfQpib29sIG1pbGxlcihpbnQgbikKewogICAgaWYgKG4gPCAyKSByZXR1cm4gZmFsc2U7CiAgICBpZiAobiAlIDIgPT0gMCB8fCBuICUgMyA9PSAwIHx8IG4gJSA1ID09IDAgfHwgbiAlIDcgPT0gMCkKICAgIHJldHVybiBuID09IDIgfHwgbiA9PSAzIHx8IG4gPT0gNSB8fCBuID09IDc7CiAgICBpbnQgbSA9IG4gLSAxLCBrID0gMDsKICAgIHdoaWxlICgobSAmIDEpID09IDApCiAgICBtID4+PSAxLCBrKys7CiAgICBmb3IgKGludCBhIDogezIsIDMsIDUsIDcsIDExLCAxMywgMTcsIDE5LCAyMywgMjksIDMxLCAzN30pCiAgICB7CiAgICAgICAgaWYgKGEgPiBuIC0gMikgYnJlYWs7CiAgICAgICAgaWYgKGNoZWNrKGEsIG4sIG0sIGspKSByZXR1cm4gZmFsc2U7CiAgICB9CiAgICByZXR1cm4gdHJ1ZTsKfQptYXRoCnsKICAgIGNpbi50aWUoMCktPnN5bmNfd2l0aF9zdGRpbygwKTsKICAgIGNpbiA+PiBuOwogICAgaWYgKG1pbGxlcihuKSkgcmV0dXJuIGNvdXQgPDwgMiwwOwogICAgcHQoMik7CiAgICBwdCgzKTsKICAgIGZvciAoaW50IGkgPSA1OyBpICogaSAqIGkgPD0gbjsgaSArPSA2KSB7CiAgICAgICAgcHQoaSk7CiAgICAgICAgcHQoaSArIDIpOwogICAgfQogICAgaWYgKG1pbGxlcihuKSkKICAgICAgICBhbnMgKj0gMjsKICAgIGVsc2UgewogICAgICAgIGludCBhID0gc3FydChuKTsKICAgICAgICBpZiAoYSAqIGEgPT0gbiAmJiBtaWxsZXIoYSkpCiAgICAgICAgICAgIGFucyAqPSAzOwogICAgICAgIGVsc2UKICAgICAgICAgICAgYW5zICo9IDQ7CiAgICB9CiAgICBjb3V0IDw8IGFucyA8PCAiXG4iOwogICAgcmV0dXJuIDA7Cn0=