import math N = int(input()) N2 = N**2 D=0 for i in range(N-1): A=N2-((i+1)**2) B=math.sqrt(A) C=B%1 if C==0: D=D+1 print(D)