N=int(input());print(sum(1for i in range(1,N)if round((y:=N*N-i*i)**.5)**2==y))