public class Euler240 {
    static long[][] buildBinom(int n) {
        long[][] c = new long[n + 1][n + 1];
        for (int i = 0; i <= n; ++i) {
            c[i][0] = 1;
            c[i][i] = 1;
            for (int j = 1; j < i; ++j) {
                c[i][j] = c[i - 1][j - 1] + c[i - 1][j];
            }
        }
        return c;
    }

    public static String solve() {
        int numDice = 20;
        int maxPoints = 12;
        int topCount = 10;
        int topSum = 70;

        long[][] choose = buildBinom(numDice);
        long[][][] dp = new long[numDice + 1][topCount + 1][topSum + 1];
        dp[numDice][0][0] = 1;

        for (int face = maxPoints; face >= 1; --face) {
            long[][][] nextDp = new long[numDice + 1][topCount + 1][topSum + 1];

            for (int rem = 0; rem <= numDice; ++rem) {
                for (int filled = 0; filled <= topCount; ++filled) {
                    for (int sum = 0; sum <= topSum; ++sum) {
                        long ways = dp[rem][filled][sum];
                        if (ways == 0)
                            continue;

                        for (int count = 0; count <= rem; ++count) {
                            int addTop = Math.min(count, topCount - filled);
                            int newFilled = filled + addTop;
                            int newSum = sum + addTop * face;

                            if (newSum > topSum)
                                continue;

                            long comb = choose[rem][count];
                            nextDp[rem - count][newFilled][newSum] += ways * comb;
                        }
                    }
                }
            }
            dp = nextDp;
        }

        return String.valueOf(dp[0][topCount][topSum]);
    }

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