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