#include using namespace std; using ll = long long; #define rep(i,m,n) for(int i=m; i> N; set st; repl(x, 1, N+1) st.insert(x*x); int ans = 0; for(ll s : st){ auto itr = st.find(N*N - s); if(itr != st.end()) ans++; } cout << ans << endl; return 0; }