import sys from itertools import permutations input = sys.stdin.readline n = int(input()) ans = 0 for a, b in permutations([*range(10)], 2): def func(p, a, b): return (p ** 2 < n * (p * a + b) + 1) min_p = max(a, b) + 1 if not(func(min_p, a, b)): continue ok = min_p ng = 10 ** 9 + 1 while(abs(ok - ng) > 1): mid = (ok + ng) // 2 if func(mid, a, b): ok = mid else: ng = mid ans += ok - min_p + 1 print(ans)