import java.util.Scanner; public class Main_yukicoder75_2 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int k = sc.nextInt(); double[] a = new double[k + 1]; double[] b = new double[k + 1]; for (int i = k - 1; i >= 0; i--) { b[i] = 1; for (int j = 1; j <= 6; j++) { if (i + j > k) { a[i] += (double)1 / 6; } else { a[i] += a[i + j] / 6; b[i] += b[i + j] / 6; } } } System.out.printf("%.3f\n", b[0] / (1 - a[0])); sc.close(); } }