using System; using static System.Console; using System.Linq; using System.Collections.Generic; class Program { static int NN => int.Parse(ReadLine()); static long[] NList => ReadLine().Split().Select(long.Parse).ToArray(); public static void Main() { Solve(); } static void Solve() { long n = NN; var ans = 0L; for (var p = 2; p <= 20; ++p) for (var a = 0; a < p && a < 10; ++a) for (var b = 0; b < p && b < 10; ++b) { if (a == b) continue; if ((a * p + b) < p * p - 1 && n * (a * p + b) > p * p - 1) { ++ans; } } for (var a = 0; a < 10; ++a) for (var b = 0; b < 10; ++b) { if (a == b) continue; if (n * (a * 21 + b) <= 21 * 21 - 1) break; var ok = 21L; var ng = 1_000_000_001L; while (ng - ok > 1) { var mid = (ok + ng) / 2; if (n * (a * mid + b) > mid * mid - 1) ok = mid; else ng = mid; } ans += ok - 20; } WriteLine(ans); } }