#include #include #include #include #include using namespace atcoder; using namespace std; using ll = long long; using ull = unsigned long long; using mll = static_modint<998244353>; #define rep(i,n) for(int i=0; i<(n); i++) int main(){ ll N; cin >> N; set G; int ans = 0; for(ll x = 1; x < N; x++) G.insert(x*x); for(ll x = 1; x < N; x++) ans += G.count(N*N - x*x); cout << ans << endl; return 0; } struct ios_do_not_sync{ ios_do_not_sync(){ ios::sync_with_stdio(false); cin.tie(nullptr); } } ios_do_not_sync_inst;