f=lambda n:sum([1for a in range(-n,n+1)for b in range(-n,n+1)if a**2+b**2==n])print f(input())
25
12
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!