using System; using System.Collections; using System.Collections.Generic; using System.Collections.Specialized; using System.Text; using System.Text.RegularExpressions; using System.Linq; using System.IO; class Program { static void Main() { new Magatro().Solve(); } } struct S { public bool[] Use; public long Price; public S(long p, bool[] u) { Price = p; Use = u; } } class Magatro { private int K; private double[] D = new double[201]; private void Scan() { K = int.Parse(Console.ReadLine()); } private bool Func(double d) { double[] dp = new double[K + 1]; dp[K] = 0; for (int i = K - 1; i >= 0; i--) { dp[i] = 1; for (int j = 1; j <= 6; j++) { if (i + j > K) { dp[i] += d / 6; } else { dp[i] += dp[i + j] / 6; } } } return d >= dp[0]; } public void Solve() { Scan(); double min = 0; double max = 10000; for (int n = 0; n < 100; n++) { double mid = (min + max) / 2; if (Func(mid)) { max = mid; } else { min = mid; } } Console.WriteLine(max); } }