n = io.read("*n") if(n <= 5) then print(0) else t = {1, 0, 0, 0, 0, 0} for i = 2, n do t[1], t[2], t[3], t[4], t[5], t[6] = t[1] * 1 / 6, t[1] * 5 / 6 + t[2] * 2 / 6, t[2] * 4 / 6 + t[3] * 3 / 6, t[3] * 3 / 6 + t[4] * 4 / 6, t[4] * 2 / 6 + t[5] * 5 / 6, t[5] * 1 / 6 + t[6] if(0.99999999 < t[6]) then break end end print(t[6]) end