n=int(input()) g=0 for p in range(2,10): for a in range(p): for b in range(p): if a!=b: f=lambda x:x**2-n*a*x-n*b-1 g+=0>f(p) L,R=10,10**9 X=10**10 for a in range(10): for b in range(10): if a!=b: f=lambda x:x**2-n*a*x-n*b-1 d=(n*a)**2-4*(-n*b-1) if d>0: if (n*a)%2==0: ok=(n*a)//2 ng=-X while abs(ok-ng)>1: m=(ok+ng)//2 if 0>f(m): ok=m else: ng=m l=ok ok=(n*a)//2 ng=X while abs(ok-ng)>1: m=(ok+ng)//2 if 0>f(m): ok=m else: ng=m r=ok else: if f((n*a-1)//2)>0: continue ok=(n*a-1)//2 ng=-X while abs(ok-ng)>1: m=(ok+ng)//2 if 0>f(m): ok=m else: ng=m l=ok ok=(n*a+1)//2+1 ng=X while abs(ok-ng)>1: m=(ok+ng)//2 if 0>f(m): ok=m else: ng=m r=ok g+=max(min(r,R)-max(l,L)+1,0) print(g)