N=int(input()) from math import sqrt ANS=0 for x in range(1,N+1): y=sqrt(N*N-x*x) if int(y)==y: ANS+=1 print(ANS-1)