#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; double sum[1001001]; double f(long long l,long long r) { double ans = 0; if(l <= 1000000) { ans += sum[min(r,1000000ll)]-sum[l-1]; } if(r < 1000000) return ans; ans += log(r+1); ans += (double)(r)/(2*(r+1)); l = max(1000001ll,l)-1; ans -= log(l+1); ans -= (double)(l)/(2*(l+1)); return ans; } template vector>> quotient_range(T N) { vector>>ans; T i = 1; for(; i*i <= N; i++) { ans.push_back({N/i,{i,i}}); } for(; i >= 1; i--) { T l = N/(i+1)+1; T r = N/i; if(l <= r && ans.back().second.first < l) { ans.push_back({N/l,{l,r}}); } } return ans; } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); long long N; cin >> N; for(int i = 1; i <= 1000000; i++) { sum[i] = sum[i-1]+1.0/i; } double ans = 0; for(auto i:quotient_range(N)) { ans += f(1,i.first)*f(i.second.first,i.second.second); } cout << fixed << setprecision(18) << ans << "\n"; }