import java.util.*; public class Main { public static void main (String[] args) { Scanner sc = new Scanner(System.in); int kk = sc.nextInt(); double[] arr = new double[kk + 1]; arr[0] = 1; double ans = 0; for (int i = 1; i < 100000; i++) { double[] next = new double[kk + 1]; for (int j = 0; j < kk; j++) { for (int k = 1; k <= 6; k++) { if (j + k > kk) { next[0] += arr[j] / 6; } else { next[j + k] += arr[j] / 6; } } } ans += next[kk] * i; arr = next; } System.out.println(ans); } }