import java.util.Scanner; public class Main_yukicoder75 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int k = sc.nextInt(); double[] e = new double[k + 1]; final double EPS = 1.e-6; double prev = 0; while (prev == 0 || e[0] == 0 || Math.abs(prev - e[0]) > EPS) { prev = e[0]; for (int i = k - 1; i >= 0; i--) { double tmp = 1.0; for (int j = 1; j <= 6; j++) { if (i + j > k) { tmp += e[0] / 6; } else { tmp += e[i + j] / 6; } } e[i] = tmp; } } System.out.printf("%.3f\n", e[0]); sc.close(); } }