#include #include #include #include #include #include #include #include using namespace std; const long long MOD = (long long)(1e9) + 7; int main() { //cout << fixed << setprecision(15); long long n; cin >> n; int ans = 0; for (long long x = 1; x * x <= n; x++) { for (long long y = 1; y * y <= n; y++) { if (x * x + y * y == n * n) { ans++; } } } cout << ans << endl; return 0; }