#include using namespace std; using ll = long long; bool func(ll n, ll p, ll a, ll b){ return (p * p < n * (p * a + b) + 1); } int main(){ ll n; cin >> n; ll ans = 0; for(ll a = 0; a < 10; ++a){ for(ll b = 0; b < 10; ++b){ if(a == b){ continue; } ll p_min = max(a, b) + 1; if(!func(n, p_min, a, b)){ continue; } ll ok = p_min, ng = 1000000001; while(abs(ok - ng) > 1){ ll mid = (ok + ng) / 2; if(func(n, mid, a, b)){ ok = mid; } else{ ng = mid; } } ans += ok - p_min + 1; } } cout << ans << endl; return 0; }