using System; using System.Collections.Generic; using System.Linq; using System.Numerics; class Solution { // nPk private static Dictionary, long> perms = new Dictionary, long>(); public static long CalcPermutation(int n, int k) { var key = Tuple.Create(n, k); if (perms.ContainsKey(key)) { return perms[key]; } if (k == 0) { return 1; } var v = CalcPermutation(n - 1, k - 1) * n; perms[key] = v; return v; } // nCk private static Dictionary, long> combs = new Dictionary, long>(); public static long CalcCombination(int n, int k) { var key = Tuple.Create(n, k); if (combs.ContainsKey(key)) { return combs[key]; } var v = CalcPermutation(n, k); for (int i = 2; i <= k; i++) { v /= i; } combs[key] = v; return v; } static BigInteger GetPattern(int n, int x) { if (n == 1) { return 1; } var pattern = (BigInteger)Math.Pow(n, x); for (int i = 1; i < n; i++) { pattern -= CalcCombination(n, i) * GetPattern(i, x); } return pattern; } static void Main() { var n = int.Parse(Console.ReadLine()); if (n >= 130) { Console.WriteLine(1); return; } var allPattern = Math.Pow(6, n); var failPattern = GetPattern(6, n); var prov = (double)failPattern / allPattern; Console.WriteLine(prov); } }