import java.io.*; import java.util.*; import java.math.*; class Main { static int k; static double[] memo; public static void out (Object o) { System.out.println(o); } public static double E (int x) { if (memo[x] != -1) return memo[x]; if (x >= k) return memo[x] = 0; return memo[x] = (E(x + 1) + E(x + 2) + E(x + 3) + E(x + 4) + E(x + 5) + E(x + 6)) / 6.0 + 1; } public static void main (String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); k = Integer.parseInt(br.readLine()); memo = new double[k + 6]; Arrays.fill(memo , -1); E(0); out(memo[0]); } }