#include using namespace std; const int MAX = 1000000; vector sum(MAX + 1); const long double GAMMA = 0.577215664901532; void precalc(){ sum[0] = 0; for (int i = 1; i <= MAX; i++){ sum[i] = sum[i - 1] + (long double) 1 / i; } } long double harmonic(long long N){ if (N <= MAX){ return sum[N]; } else { return logl(N) + GAMMA + (double) 1 / (N * 2) - 1 / (12 * pow(N, 2)); } } vector>> quotient_ranges(long long N){ vector>> ans; for (long long i = 1; i * i <= N; i++){ ans.push_back(make_pair(N / i, make_pair(i, i))); } for (long long i = N / ((long long) sqrt(N) + 1); i >= 1; i--){ ans.push_back(make_pair(i, make_pair(N / (i + 1) + 1, N / i))); } return ans; } int main(){ precalc(); cout << fixed << setprecision(20); long long N; cin >> N; vector>> Q = quotient_ranges(N); int cnt = Q.size(); long double ans = 0; for (int i = 0; i < cnt; i++){ long long q = Q[i].first; long long mn = Q[i].second.first; long long mx = Q[i].second.second; ans += harmonic(q) * (harmonic(mx) - harmonic(mn - 1)); } cout << ans << endl; }