#include using namespace std; using i64 = int64_t; using ll = long long; using lint = long long; typedef vector vint; typedef pair pint; #define INF INT32_MAX / 2 #define INF64 INT64_MAX / 2 #define EPS 0.001 #define EPS14 1.0E-14 #define REP(i, n) for (ll i = 0; i < n; i++) #define all(x) (x).begin(),(x).end() #define rall(x) (x).rbegin(),(x).rend() #define ALL(f,c,...) (([&](decltype((c)) cccc) { return (f)(std::begin(cccc), std::end(cccc), ## __VA_ARGS__); })(c)) #define c(n) cout<inline bool chmin(T&a,T b) {if(a>b){a=b;return true;}return false;} template inline bool chmax(T&a,T b) {if(ainline T sum(T n){return n*(n+1)/2;} map prime_fac(ll A) {mapmp;for(ll i=2;i*i<=A;i++){while(A%i== 0){mp[i]++;A/=i;}}if(A!=1){mp[A]=1;}return mp;} bool is_prime(ll N){if(N<=1)return false;for(ll i=2;i*i<=N;i++){if(N%i==0) return false;}return true;} templateinline T myceil(T a,T b){return (a+(b-1))/b;} ll pw(ll x, ll n){ll ret=1;while(n>0){if(n&1){ret*=x;}x *= x;n >>= 1;}return ret;} bool is_product_overflow(long long a,long long b) {long prod=a*b;return (prod/b!=a);} int main() { ll N; cin >> N; ll ans = 0; for (ll i = 1; i * i <= pw(N, 2); i++) { ll x = pw(floor(sqrt(pw(N, 2) - pw(i, 2))), 2); if (x && x == pw(N, 2) - pw(i, 2)) { ans++; } } c(ans) }