import sys, math from itertools import permutations input = sys.stdin.readline def ceil_sqrt(n): rn = math.sqrt(n) ok = max(0, int(rn - 2)) ng = int(rn + 2) while(ng - ok > 1): k = (ok + ng) >> 1 if(k * k <= n): ok = k else: ng = k return ok + (ok ** 2 != n) n = int(input()) def check(p, a, b): return (p ** 2 < n * (p * a + b) + 1) ans = 0 for a, b in permutations([*range(10)], 2): min_p = max(a, b) + 1 if not(check(min_p, a, b)): continue left = min_p * 2 right = n * a + ceil_sqrt((n * a) ** 2 + 4 * (n * b + 1)) ans += ((right - left) >> 1) + (right & 1) print(ans)