import java.util.ArrayList;
import java.util.Locale;

public class Euler640 {
    static class Outcome {
        int x, y;
        double p;

        Outcome(int x, int y, double p) {
            this.x = x;
            this.y = y;
            this.p = p;
        }
    }

    static double solveOptimalExpected(int cards, ArrayList<Outcome> outs) {
        int S = 1 << cards;
        int goal = S - 1;

        int[][][] pol = new int[S][outs.size()][3];
        for (int s = 0; s < S; ++s) {
            for (int oi = 0; oi < outs.size(); ++oi) {
                Outcome out = outs.get(oi);
                pol[s][oi][0] = out.x - 1;
                pol[s][oi][1] = out.y - 1;
                pol[s][oi][2] = out.x + out.y - 1;
            }
        }

        double[] V = new double[S];
        V[goal] = 0.0;

        class Evaluator {
            void evalPolicy(int iters, double eps) {
                for (int it = 0; it < iters; ++it) {
                    double delta = 0.0;
                    for (int s = 0; s < S; ++s) {
                        if (s == goal)
                            continue;
                        double ex = 0.0;
                        for (int oi = 0; oi < outs.size(); ++oi) {
                            int nxt = s ^ (1 << pol[s][oi][0]);
                            ex += outs.get(oi).p * V[nxt];
                        }
                        double nv = 1.0 + ex;
                        delta = Math.max(delta, Math.abs(nv - V[s]));
                        V[s] = nv;
                    }
                    if (delta < eps)
                        break;
                }
            }

            boolean improvePolicy() {
                boolean changed = false;
                for (int s = 0; s < S; ++s) {
                    if (s == goal)
                        continue;
                    for (int oi = 0; oi < outs.size(); ++oi) {
                        int[] acts = pol[s][oi];
                        int best_idx = 0;
                        double best_v = 1e300;
                        for (int k = 0; k < 3; ++k) {
                            int nxt = s ^ (1 << acts[k]);
                            double v = V[nxt];
                            if (v < best_v) {
                                best_v = v;
                                best_idx = k;
                            }
                        }
                        if (best_idx != 0) {
                            int temp = acts[0];
                            acts[0] = acts[best_idx];
                            acts[best_idx] = temp;
                            changed = true;
                        }
                    }
                }
                return changed;
            }
        }

        Evaluator ev = new Evaluator();
        for (int round = 0; round < 50; ++round) {
            ev.evalPolicy(10000, 1e-15);
            if (!ev.improvePolicy())
                break;
        }

        ev.evalPolicy(50000, 1e-18);
        return V[0];
    }

    public static String solve() {
        ArrayList<Outcome> dice = new ArrayList<>();
        for (int x = 1; x <= 6; ++x) {
            for (int y = 1; y <= 6; ++y) {
                dice.add(new Outcome(x, y, 1.0 / 36.0));
            }
        }
        double e = solveOptimalExpected(12, dice);
        return String.format(Locale.US, "%.6f", e);
    }

    public static void main(String[] args) {
        System.out.println(solve());
    }
}
