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