import java.util.Scanner; public class Main_yukicoder75_1 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int k = sc.nextInt(); double[] dp = new double[k + 1]; double l = 0; double r = 1000; for (int loop = 0; loop < 40; loop++) { double mid = (l + r) / 2; for (int i = k - 1; i >= 0; i--) { double tmp = 1.0; for (int j = 1; j <= 6; j++) { if (i + j > k) { tmp += mid / 6; } else { tmp += dp[i + j] / 6; } } dp[i] = tmp; } if (dp[0] > mid) { l = mid; } else { r = mid; } } System.out.printf("%.3f\n", dp[0]); sc.close(); } }