#define rep(i,n) for(int i=0;i<(int)(n);i++) #define ALL(v) v.begin(),v.end() typedef long long ll; #include using namespace std; int main(){ ios::sync_with_stdio(false); std::cin.tie(nullptr); ll n; cin>>n; vector A; for(ll i=1;i<=200000;i++){ A.push_back(i*i); } ll cnt=0; for(auto t:A){ if(n*n==*lower_bound(ALL(A),n*n-t)+t) cnt++; } cout<