#include #define rep(i, l, n) for (ll i = (l); i < (n); i++) using namespace std; using ll = long long; bool check(ll n, ll p, ll a, ll b) { return (p * p < n * (p * a + b) + 1); } int main(void) { ll n; cin >> n; ll ans = 0; rep(a, 0, 10) { rep(b, 0, 10) { if (a == b) { continue; } ll min_p = max(a, b) + 1; if (check(n, min_p, a, b) == false) { continue; } ll ok = min_p, ng = 1000000000ll; while (ng - ok > 1) { ll p = (ok + ng) >> 1; if (check(n, p, a, b)) { ok = p; } else { ng = p; } } ans += ok - min_p + 1; } } cout << ans << endl; return 0; }