import java.util.*;

public class Euler367 {

    static void dfs(int rem, int maxPart, List<Integer> cur, List<List<Integer>> parts) {
        if (rem == 0) {
            parts.add(new ArrayList<>(cur));
            return;
        }
        for (int x = Math.min(rem, maxPart); x >= 1; x--) {
            cur.add(x);
            dfs(rem - x, x, cur, parts);
            cur.remove(cur.size() - 1);
        }
    }

    static List<List<Integer>> generatePartitions(int n) {
        List<List<Integer>> parts = new ArrayList<>();
        dfs(n, n, new ArrayList<>(), parts);
        return parts;
    }

    static int[] buildRepresentativePermutation(int n, List<Integer> partition) {
        int[] perm = new int[n];
        int cur = 0;
        for (int len : partition) {
            if (len == 1) {
                perm[cur] = cur;
                cur++;
                continue;
            }
            for (int i = 0; i < len - 1; i++) {
                perm[cur + i] = cur + i + 1;
            }
            perm[cur + len - 1] = cur;
            cur += len;
        }
        return perm;
    }

    static List<Integer> cycleTypePartition(int[] perm) {
        int n = perm.length;
        boolean[] vis = new boolean[n];
        List<Integer> lengths = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            if (vis[i])
                continue;
            int j = i;
            int len = 0;
            while (!vis[j]) {
                vis[j] = true;
                j = perm[j];
                len++;
            }
            lengths.add(len);
        }
        lengths.sort(Collections.reverseOrder());
        return lengths;
    }

    static long factorial(int n) {
        long v = 1;
        for (int i = 2; i <= n; i++)
            v *= i;
        return v;
    }

    static long classSize(int n, List<Integer> partition) {
        long num = factorial(n);
        int[] freq = new int[n + 1];
        for (int len : partition)
            freq[len]++;

        long den = 1;
        for (int len = 1; len <= n; len++) {
            int cnt = freq[len];
            if (cnt == 0)
                continue;
            long p = 1;
            for (int i = 0; i < cnt; i++)
                p *= len;
            den *= p;
            den *= factorial(cnt);
        }
        return num / den;
    }

    static double solveAverageExpectation(int n) {
        List<List<Integer>> partitions = generatePartitions(n);
        int ccount = partitions.size();

        Map<List<Integer>, Integer> classIndex = new HashMap<>();
        for (int i = 0; i < ccount; i++) {
            classIndex.put(partitions.get(i), i);
        }

        List<int[]> reps = new ArrayList<>();
        for (List<Integer> part : partitions) {
            reps.add(buildRepresentativePermutation(n, part));
        }

        List<Integer> identityPartition = new ArrayList<>();
        for (int i = 0; i < n; i++)
            identityPartition.add(1);
        int idIdx = classIndex.get(identityPartition);

        List<Integer> unknownClasses = new ArrayList<>();
        for (int i = 0; i < ccount; i++) {
            if (i != idIdx)
                unknownClasses.add(i);
        }
        int m = unknownClasses.size();

        int transTotal = n * (n - 1) / 2;
        int cycle3Total = n * (n - 1) * (n - 2) / 3;

        double[][] a = new double[m][m + 1];

        for (int ri = 0; ri < m; ri++) {
            int cls = unknownClasses.get(ri);
            int[] perm = reps.get(cls);

            int[] cnt2 = new int[ccount];
            int[] cnt3 = new int[ccount];

            for (int x = 0; x < n; x++) {
                for (int y = x + 1; y < n; y++) {
                    int[] q = perm.clone();
                    int tmp = q[x];
                    q[x] = q[y];
                    q[y] = tmp;
                    int to = classIndex.get(cycleTypePartition(q));
                    cnt2[to]++;
                }
            }

            for (int x = 0; x < n; x++) {
                for (int y = x + 1; y < n; y++) {
                    for (int z = y + 1; z < n; z++) {
                        int[] q = perm.clone();
                        int px = q[x], py = q[y], pz = q[z];
                        q[x] = py;
                        q[y] = pz;
                        q[z] = px;
                        int to = classIndex.get(cycleTypePartition(q));
                        cnt3[to]++;

                        q = perm.clone();
                        q[x] = pz;
                        q[y] = px;
                        q[z] = py;
                        to = classIndex.get(cycleTypePartition(q));
                        cnt3[to]++;
                    }
                }
            }

            for (int cj = 0; cj < m; cj++) {
                int clsTo = unknownClasses.get(cj);
                double p2 = (double) cnt2[clsTo] / transTotal;
                double p3 = (double) cnt3[clsTo] / cycle3Total;

                double coef = -0.5 * p2 - (1.0 / 3.0) * p3;
                if (cls == clsTo)
                    coef += 5.0 / 6.0;
                a[ri][cj] = coef;
            }
            a[ri][m] = 1.0;
        }

        for (int col = 0; col < m; col++) {
            int pivot = col;
            for (int r = col + 1; r < m; r++) {
                if (Math.abs(a[r][col]) > Math.abs(a[pivot][col]))
                    pivot = r;
            }
            double[] temp = a[col];
            a[col] = a[pivot];
            a[pivot] = temp;

            double pv = a[col][col];
            for (int j = col; j <= m; j++)
                a[col][j] /= pv;

            for (int r = 0; r < m; r++) {
                if (r == col)
                    continue;
                double factor = a[r][col];
                if (Math.abs(factor) < 1e-30)
                    continue;
                for (int j = col; j <= m; j++) {
                    a[r][j] -= factor * a[col][j];
                }
            }
        }

        double[] h = new double[ccount];
        for (int ri = 0; ri < m; ri++) {
            int cls = unknownClasses.get(ri);
            h[cls] = a[ri][m];
        }
        h[idIdx] = 0.0;

        long totalPerm = factorial(n);
        double weightedSum = 0.0;
        for (int i = 0; i < ccount; i++) {
            long sz = classSize(n, partitions.get(i));
            weightedSum += sz * h[i];
        }

        return weightedSum / totalPerm;
    }

    static String solve() {
        double avg11 = solveAverageExpectation(11);
        long ans = Math.round(avg11);
        return Long.toString(ans);
    }

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