#include using namespace std; using ld = long double; int main() { int n; cin >> n; vector dp(n + 1, -1); auto f = [&](auto f, int x) -> ld { if (x <= 1) { return x == 1 ? 1.0 : 0.0; } if (dp[x] != -1) { return dp[x]; } ld res = 0.0; for (int y = 0; y < x; y++) { int a = y, b = x - 1 - y; ld p1 = 1.0 / 2.0; ld p2 = 1.0 / (ld)x; res += (f(f, a) + f(f, b)) * p1 * p2 + 1.0; } dp[x] = res; return res; }; cout << fixed << setprecision(15) << f(f, n) << endl; }