n = int(input()) cnt = 0 for x in range(1, n+1): y = n**2-x**2 if x**2+y == n**2 and 0 < y and (y**0.5).is_integer(): cnt += 1 print(cnt)