#include using namespace std; using ll = long long; #ifdef LOCAL #include "debug.hpp" #define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__) #else #define debug(...) #endif int main() { ios::sync_with_stdio(false); cin.tie(0); ll N; cin >> N; ll ans = 0; for (ll i = 1; i < 1000; i++) { for (ll j = 1; j < 1000; j++) { ll temp = i * i + j * j; if (temp == N * N) ans++; } } cout << ans << '\n'; return 0; }