import java.util.*;
import java.math.*;

public class Young {
    public static HashMap<String, BigInteger> muisti =
                  new HashMap<String, BigInteger>();

    public static BigInteger haku(int n, int[][] taulu, int m) {
        if (m == 0) return BigInteger.ONE;
        BigInteger tulos = BigInteger.ZERO;
        String koodi = Arrays.deepToString(taulu);
        if (muisti.containsKey(koodi)) return muisti.get(koodi);
        for (int i = 0; i < n; i++) {
            for (int j = n-1; j >= 0; j--) {
                if (taulu[i][j] == 1) continue;
                if (i < n-1 && taulu[i+1][j] == 0) break;
                if (j < n-1 && taulu[i][j+1] == 0) break;
                taulu[i][j] = 1;
                tulos = tulos.add(haku(n, taulu, m-1));
                taulu[i][j] = 0;
            }
        }
        muisti.put(koodi, tulos);
        return tulos;
    }

    public static BigInteger laske(int n) {
        return haku(n, new int[n][n], n*n);
    }

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