//naive #include using namespace std; using i64=long long; int main(){ i64 N; cin >> N; if(N>1e8)return 0; i64 ans=0; for(i64 i=1;4*i*i<=N;i++)for(i64 j=i+1;2*j*j+2*i*j<=N;j+=2)if(__gcd(i,j)==1)ans+=N/(2*j*j+2*i*j); cout << ans << endl; }