#include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using ll = long long; int main(){ ll N, ans=0; cin >> N; for (int p=2; p<=9; p++){ for (int a=0; a<=p-1; a++){ for (int b=0; b<=p-1; b++){ if (a == b) continue; if (p*p-N*a*p-11){ c = (l+r)/2; if (N*b>c*c-N*a*c-1) l=c; else r=c; } ans += max(0LL, l-9); } } cout << ans << endl; return 0; }