#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <cfloat>
#include <ctime>
#include <cassert>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <numeric>
#include <list>


using namespace std;

#ifdef _MSC_VER
#define __typeof__ decltype
template <class T> int __builtin_popcount(T n) { return n ? 1 + __builtin_popcount(n & (n - 1)) : 0; }
#endif

#define foreach(it, c) for (__typeof__((c).begin()) it=(c).begin(); it != (c).end(); ++it)
#define all(c) (c).begin(), (c).end()
#define rall(c) (c).rbegin(), (c).rend()
#define CLEAR(arr, val) memset(arr, val, sizeof(arr))

#define rep(i, n) for (int i = 0; i < n; ++i)

template <class T> void max_swap(T& a, const T& b) { a = max(a, b); }
template <class T> void min_swap(T& a, const T& b) { a = min(a, b); }

typedef long long ll;
typedef pair<int, int> pint;

const double EPS = 1e-8;
const double PI = acos(-1.0);
const int dx[] = { 0, 1, 0, -1 };
const int dy[] = { 1, 0, -1, 0 };



int main()
{
	static int dp[1 << 10][810];
	dp[0][0] = 1;
	for (int s = 0; s < 1 << 10; ++s)
	{
		int n = __builtin_popcount(s);
		for (int k = 0; k < 10; ++k)
		{
			if (!(s >> k & 1))
			{
				int ns = s | (1 << k);
				int add = (n + 1) * k;

				for (int i = 0; i < 333; ++i)
					dp[ns][i + add] += dp[s][i];
			}
		}
	}

	static int table[11][810];
	for (int s = 0; s < 1 << 10; ++s)
		for (int i = 0; i < 333; ++i)
			table[__builtin_popcount(s)][i] += dp[s][i];

	int n, s;
	while (~scanf("%d%d", &n, &s))
		printf("%d\n", table[n][s]);
}