#include #include using namespace std; using namespace atcoder; using ll = long long; using ld = long double; ll N, ans = 0; int main() { cin >> N; for (ll x = 1; x * x <= N * N; x++) { ll y2 = N * N - x * x; double yd = sqrtl(y2); ll y = floor(yd); if (y > 0 && y == yd) { ans++; } } cout << ans << endl; return 0; }