N = int(input()) ans = 0 for a in range(10): for b in range(10): if a==b:continue high = a*N+N*b+1 low = 0 while high-low>1: mid = (high+low)//2 if N*(mid*a+b)>mid**2-1: low = mid else: high = mid pmax = low if pmax>=max(a+1,b+1,2): ans += pmax-max(a+1,b+1,2)+1 print(ans)