#include #include using namespace std; long long N; long long Answer = 0; int main() { cin >> N; for (int x = 1; x <= N - 1; x++) { long long V = N * N - 1LL * x * x; long long y = (long long)(sqrt(1.0 * V)); if (x * x + y * y == N * N) Answer++; } cout << Answer << endl; return 0; }