import java.util.Arrays; import java.util.HashSet; import java.util.LinkedList; import java.util.Scanner; import java.util.Set; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); final int K = sc.nextInt(); final int size = 6 * K; double[][] ok = new double[K + 1][size + 1]; double[] over = new double[K + 1]; ok[0][0] = 1; for(int i = 1; i <= 6; i++){ ok[1][i] = 1.0 / 6; } for(int i = 2; i <= K; i++){ for(int j = 0; j <= size; j++){ for(int k = 1; k <= 6; k++){ final int index = j - k; if(index < 0){ continue; } if(index >= K){ continue; } ok[i][j] += ok[i - 1][index] / 6; } } } for(int i = 1; i <= K; i++){ for(int j = 1; j <= 5; j++){ final int index = K - j; if(index < 0){ continue; } if(index >= K){ continue; } //System.out.println(i + " " + j + " " + index); over[i] += ok[i - 1][K - j] * (1.0 - j / 6.0); } } //System.out.println(Arrays.toString(ok[1])); //System.out.println(Arrays.toString(ok[2])); //System.out.println(Arrays.toString(over)); double upper_sum = 0; for(int i = 1; i <= K; i++){ upper_sum += (ok[i][K] + over[i]) * i; } final double over_sum = Arrays.stream(over).sum(); System.out.printf("%.8f\n", (upper_sum / (1.0 - over_sum))); } }