#include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; const ll MOD = 1000003; int main(void) { ll L; cin >> L; int ans = 0; int limit = 0; for (limit = 0; limit*limit <= L; limit++) {} for (int n = 1; n < limit; n++) { for (int m = n+1; m < limit; m += 2) { if (__gcd(m, n) != 1) continue; ll a = m*m - n*n; ll b = 2*m*n; ll c = m*m+n*n; if (L >= (a+b+c) * 4) ans++; } } cout << ans << endl; return 0; }