#include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>	// require sort next_permutation count __gcd reverse etc.
#include <cstdlib>	// require abs exit atof atoi 
#include <cstdio>		// require scanf printf
#include <functional>
#include <numeric>	// require accumulate
#include <cmath>		// require fabs
#include <climits>
#include <limits>
#include <cfloat>
#include <iomanip>	// require setw
#include <sstream>	// require stringstream 
#include <cstring>	// require memset
#include <cctype>		// require tolower, toupper
#include <fstream>	// require freopen
#include <ctime>		// require srand
#define rep(i,n) for(int i=0;i<(n);i++)
#define ALL(A) A.begin(), A.end()

using namespace std;

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

int table[12][1024];

void dfs (int bit, int depth, int sum )
{
	table[depth][sum]++;

	rep (i, 10 ){
		if (bit & (1<<i ) ){
			dfs (bit & ~(1<<i), depth + 1, sum + i*(depth+1) );
		} // end if
	} // end rep
	
}
int main()
{
//	cut here before submit 
//	freopen ("testcase.aoj0070", "r", stdin );
	int n, s;
	memset (table, 0, sizeof (table ) );

	dfs ((1<<10)-1, 0, 0 );

	while (scanf ("%d %d", &n, &s ) != EOF ){
		int res = (s > 330 ? 0 : table[n][s] );
		cout << res << endl;
	} // end while

	return 0;
}