#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 <= 1000; x++) { for (long long y = 1; y <= 1000; y++) { if (x * x + y * y == n * n) { ans++; } } } cout << ans << endl; return 0; }