#include #include using namespace std; typedef long long LL; int main() { LL N,N2; cin >> N; N2 = N * N; LL nums = 0; for (int x = 1; x < N; x++) { double y = sqrt(N*N - x * x); if (y==(int)y && x * x + y*y == N2) { nums++; } } cout << nums << endl; return 0; }