#define rep(i,n) for(int i=0;i<(int)(n);i++) #define ALL(v) v.begin(),v.end() typedef long long ll; #include using namespace std; ll sqr(ll x){ ll tmp=sqrt(x); if((tmp+1)<=x/(tmp+1)) return tmp+1; if(tmp<=x/tmp) return tmp; return tmp-1; } int main(){ ios::sync_with_stdio(false); std::cin.tie(nullptr); ll n; cin>>n; ll ans=0; for(int a=0;a<10;a++){ for(int b=0;b<10;b++){ if(a==b) continue; ll s=sqr(a*a*n*n+4+4*b*n); ll tmp=(a*n+s)/2; if(tmp<=max(a,b)) continue; ans+=tmp-max(a,b); if(s*s==a*a*n*n+4+4*b*n) ans--; } } cout<