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