#include <bits/stdc++.h>

using ll = long long;
const int maxn = 2e6 + 3;

std::vector<ll> d;

int main() {
    ll n;
    scanf("%lld", &n);
    for(ll i = 1; i <= n; ++i) {
        if((n * n) % i)
            continue;
        d.push_back(i);
    }
    for(ll i = n - 1; i >= 1; --i) {
        if((n * n) % i)
            continue;
        d.push_back(n * n / i);
    }
    ll ans = 0;
    for(auto &&x : d) {
        for(auto &&y : d) {
            if(y > x || x > n * n / y)
                break;
            double b = x * y * (double)(x + y);
            double d2 = b * b + 4. * n * n * x * y;
            double d = sqrt(d2);
            ll l = (-b + d) / (double)(2. * x * y);
            for(ll z = std::max(x, l - 1ll); z <= l + 1ll; ++z) {
                if(z * y <= n * n / x && z * (x + y + z) * y == n * n / x) {
                    ans += 1;
                    break;
                }
            }
        }
    }
    printf("%lld\n", ans);
    return 0;
}