##Python, 133 129 bytes
Python, 133 129 bytes
from itertools import*
n=input()
l=[];s=0
for i in range(-n,n+1):l.append(i**2)
for j in product(l,l):
if sum(j)==n:s+=1
print s
This demonstrates the use of itertools cartesian product. Try it online