#ifdef __LOCAL #define _GLIBCXX_DEBUG #endif #include using namespace std; using ll = long long; using P = pair; using PIL = pair; using PLI = pair; using PLL = pair; template bool chmin(T &a, T b) {if(a>b){a=b;return 1;}return 0;} template bool chmax(T &a, T b) {if(a void show_vec(T v) {for (int i=0;i void show_pair(T p) {cout< bool judge_digit(T bit,T i) {return (((bit&(1LL< h_idx4 = {-1, 0,0,1}; const vector w_idx4 = { 0,-1,1,0}; const vector h_idx8 = {-1,-1,-1, 0,0, 1,1,1}; const vector w_idx8 = {-1, 0, 1,-1,1,-1,0,1}; int main(){ ios::sync_with_stdio(false); cin.tie(0); cout << fixed << setprecision(15); ll n; cin >> n; set S; for (ll i = 1; i <= 200005; i++){ S.insert(i * i); } ll ans = 0; for (ll i = 1; i * i < n * n; i++){ ll y = (n * n) - (i * i); if (S.count(y)) ans++; } cout << ans << endl; }