n = int(input()) def func(x, a, b): return x**2 - n * a * x - n * b - 1 ans = 0 for a in range(10): for b in range(10): if a == b: continue min_p = max(a, b) + 1 if func(min_p, a, b) >= 0: continue left, right = min_p, 10**9 + 1 while right - left > 1: mid = (left + right) // 2 if func(mid, a, b) < 0: left = mid else: right = mid ans += left - min_p + 1 print(ans)