#include<iostream>
#include<cstring>
#include<cmath>
using namespace std;
int x[11][600][1024], y[11][600], n, s;
int main() {
	x[0][0][0] = 1;
	for (int i = 1; i <= 10; i++) {
		for (int j = 0; j < 500; j++) {
			for (int k = 0; k < 1024; k++) {
				for (int l = 0; l < 10; l++) {
					if ((k / (1 << l)) % 2 == 0) {
						x[i][j + i*l][k + (1 << l)] += x[i - 1][j][k];
					}
				}
			}
		}
	}
	for (int i = 0; i <= 10; i++) {
		for (int j = 0; j < 500; j++) {
			for (int k = 0; k < 1024; k++) {
				y[i][j] += x[i][j][k];
			}
		}
	}
	while (cin >> n >> s) {
		cout << y[n][s] << endl;
	}
}