import java.math.BigInteger;

public class Euler723 {
    public static String solve() {
        int[] exps = { 6, 3, 2, 1, 1, 1, 1, 1 };

        BigInteger t1Term = BigInteger.ONE;
        for (int e : exps) {
            long val = (long) (e + 1) * (e + 2) / 2;
            t1Term = t1Term.multiply(BigInteger.valueOf(val));
        }
        BigInteger t1 = BigInteger.valueOf(7).multiply(t1Term);

        BigInteger t2Term = BigInteger.ONE;
        for (int e : exps) {
            long val = (long) (e + 1) * (e + 2) * (2 * e + 3) / 6;
            t2Term = t2Term.multiply(BigInteger.valueOf(val));
        }
        BigInteger t2 = BigInteger.valueOf(14).multiply(t2Term);

        BigInteger t3Term = BigInteger.ONE;
        for (int e : exps) {
            long a = (long) (e + 1) * (e + 2) * (2 * e + 3) / 6;
            long b = e / 2 + 1;
            long val = (a + b) / 2;
            t3Term = t3Term.multiply(BigInteger.valueOf(val));
        }
        BigInteger t3 = BigInteger.valueOf(4).multiply(t3Term);

        BigInteger t4Term = BigInteger.ONE;
        for (int e : exps) {
            long x = (long) (e + 1) * (e + 2) / 2;
            long val = x * x;
            t4Term = t4Term.multiply(BigInteger.valueOf(val));
        }
        BigInteger t4 = BigInteger.valueOf(8).multiply(t4Term);

        BigInteger t5Term = BigInteger.ONE;
        for (int e : exps) {
            long val = (long) (e + 1) * (e + 2) * (e * e + 3 * e + 3) / 6;
            t5Term = t5Term.multiply(BigInteger.valueOf(val));
        }
        BigInteger t5 = BigInteger.valueOf(4).multiply(t5Term);

        BigInteger ans = t1.subtract(t2).subtract(t3).add(t4).add(t5);
        return ans.toString();
    }

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