#include using ll = long long; #define REP(i, n) for(ll i = 0; (i) < ll(n); ++ (i)) #define FOR(i, m, n) for(ll i = (m); (i) <= ll(n); ++ (i)) #define REPR(i, n) for(ll i = ll(n) - 1; (i) >= 0; -- (i)) #define FORR(i, m, n) for(ll i = ll(n) - 1; (i) >= ll(m); -- (i)) #define ALL(x) x.begin(),x.end() #define INF (int)1e9 #define LLINF (long long)1e18 #define MOD (int)(1e9+7) #define MOD9 (int)998244353 #define PI 3.141592653589 #define PB push_back #define F first #define S second #define YESNO(T) if(T){cout<<"YES"< > #define CostGraph vector > > #define PII pair #define PLL pair #define VI vector #define VL vector #define VVI vector > #define VVL vector > #define VPII vector > #define VPLL vector > #define DDD fixed< 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(a < b){a = b; return true;} return false; } template T GCD(T a, T b) { if (b == 0) return a; return GCD(b, a % b); } template inline T LCM(T a, T b) { return (a * b) / GCD(a, b); } struct input{ int n; input() {} input(int n_) : n(n_){}; template operator T(){ T ret; std::cin >> ret; return ret; } template operator std::vector() { std::vector ret(n); REP(i,n) std::cin >> ret[i]; return ret; } }; template inline void printVec(std::vector v){ REP(i,v.size()){ if(i) std::cout << " "; std::cout << v[i]; } std::cout << std::endl; } using namespace std; #include using namespace atcoder; using mint = modint998244353; template bool isSquareNumber(T i){ T j = 0; while(j * j < i) ++j; return j * j == i; } int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); ll n; cin >> n; int ans = 0; FOR(i,1,n-1){ if(isSquareNumber(n * n - i * i)) ++ans; } cout << ans << endl; }