n=int(input()) cnt =0 for i in range(1,n+1): t = n*n - i*i if t <= 0: break if t**0.5 == int(t**0.5): cnt += 1 print(cnt)