N = int(input()) cnt = 0 for i in range(1, 448): for j in range(1, 448): if i**2+j**2 == N**2: cnt += 1 print(cnt)