#include<iostream>
#include<string>
#include<cmath>
#include<queue>
#include<map>
#include<set>
#include<list>
#include<iomanip>
#include<vector>
#include<functional>
#include<algorithm>
#include<cstdio>
#include<unordered_map>
using namespace std;
//---------------------------------------------------
//????????????????????????????????????
#define int long long
#define str string
typedef long long ll;
typedef long double ld;
const ll inf = 999999999999999999;
struct P {
	ll pos, cost;
};
bool operator<(P a, P b) { return a.cost < b.cost; }
bool operator>(P a, P b) { return a.cost > b.cost; }
struct B {
	ll to, cost;
};
ll gcm(ll i, ll j) {//?????§??¬?´???°
	if (i > j) swap(i, j);
	if (i == 0) return j;
	return gcm(j%i, i);
}

//---------------------------------------------------
//+++++++++++++++++++++++++++++++++++++++++++++++++++
int n, s;
int dp[11][331][1024];
signed main() {
	dp[0][0][0] = 1;
	for (int i = 0; i < 10; i++) 
		for (int j = 0; j < 331; j++) 
			for (int z = 0; z < 1024; z++) 
				if (dp[i][j][z] > 0) 
					for (int x = 0; x < 10; x++) 
						if (!((1 << x)&z))
							dp[i + 1][j + x*(i + 1)][z | (1 << x)] += dp[i][j][z];
	while (cin >> n >> s) {
		if (s > 330) {
			cout << 0 << endl;
			continue;
		}
		int ans = 0;
		for (int i = 0; i < 1024; i++)
			ans += dp[n][s][i];
		cout << ans << endl;
	}
	//getchar(); getchar();
}