#include int main(void) { int count = 0, num, numSquare, iSquare,i,j; scanf("%d", &num); numSquare = num * num; j = num; for (i = 1; i < num; i++) { iSquare = i * i; while ((iSquare + j * j) > numSquare) { j--; if (j < 1) { break; } } if ((iSquare + j * j) == numSquare) { count++; } } printf("%d", count); return 0; }