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