// 愚直解 #include #define ll long long #define max(a, b) (((a) < (b)) ? (b) : (a)) #pragma GCC target("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #pragma warning(disable: 4996) int main(void) { ll n; scanf("%lld", &n); ll ans = 0; for (ll a = 0; a < 10; ++a) { for (ll b = 0; b < 10; ++b) { if (a == b) { continue; } ll min_p = max(a, b) + 1; if (min_p * min_p >= n * (min_p * a + b) + 1) { continue; } ll p; for (p = min_p; p * p < n * (p * a + b) + 1; ++p); ans += p - min_p; } } printf("%lld\n", ans); return 0; }