#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 = 1.0; for (int y = 0; y < x; y++) { int a = y, b = x - 1 - y; ld p = 1.0 / (ld)x; res += (f(f, a) + f(f, b)) * p; } dp[x] = res; return res; }; cout << fixed << setprecision(15) << f(f, n) << endl; }