N = gets.to_i P = {} P[0] = 1 (1..N).each{|n| P[n] = P[n-1] * n} cost = 1 for n in 2..N do c1 = cost * n c2 = P[n-1] * 2 sum = 0 cnt = 0 for x in 1..n-2 do for y in x+1..n-1 do sum += x * y cnt += 1 end end c3 = cnt > 0 ? sum * (P[n] - P[n-1] * 2) / cnt : 0 cost = c1 + c2 + c3 end puts cost / P[N].to_f