#include using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (int)(n); i++) //okita int main(){ ll N;cin>>N; ll ct = 0; for(ll i=1;i<=N;i++){ ll X = N*N-i*i; ll Y = sqrt(X); if(X==Y)ct+=2; if(i*i==X)ct--; } cout<