local n = io.read("*n") local t = {} t[1] = 1 for i = 2, n do local c = 0 for j = 0, i - 1 do local a, b = j, i - j - 1 if 0 < a then c = c + t[a] end if 0 < b then c = c + t[b] end end t[i] = 1 + c / i end print(string.format("%.10f", t[n]))