import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int K = scanner.nextInt(); double[] dp = new double[K + 1]; dp[K] = 0; for (int i = K - 1; i >= 0; i--) { for (int j = 1; j <= 6; j++) { if (i + j <= K) { dp[i] += dp[i + j] / 6; } } dp[i] += 1; } System.out.println(dp[0]); } }