# include using namespace std; typedef long long ll; // # define int long long # define lc u << 1 # define rc u << 1 | 1 # define fi first # define se second int n; signed main () { // freopen ("card.in", "r", stdin); freopen ("card.out", "w", stdout); scanf ("%d", &n); double ans = 1; for (int i = 2; i <= n; i ++ ) { ans += 2.0 / i; // 两边 if (i > 2) { double p = ((i - 1) * i / 2) * ((i - 1) * i / 2) - (i - 1) * i * (2 * i - 1) / 6; p /= (i - 1) * (i - 2); ans += p * (i - 2.0) / i; } } printf ("%.10lf\n", ans); return 0; }