N = int(input()) ans = 0 for x in range(1,N+1): y = (N**2-x**2)**0.5 if y.is_integer(): ans += 1 print(ans-1)