import Control.Applicative ((<$>)) main :: IO () main = solve <$> readLn >>= print solve :: Int -> Double solve k = head . (!! k) $ iterate f (replicate 6 0.0) where f :: [Double] -> [Double] f xs = let xs6 = take 6 xs in (sum xs6 / 6.0 + 1.0) : xs6