# WA(?) import sys, math from itertools import permutations input = sys.stdin.readline 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 right = (n * a + math.sqrt((n * a) ** 2 + 4 * (n * b + 1))) / 2 ans += int(right) - left + 1 print(ans)