#include <bits/stdc++.h>
using namespace std;

int dp[20][300][2048];

int main()
{
	int n, s;
	while (scanf("%d %d", &n, &s) != EOF){
		memset(dp, 0, sizeof(dp));
		dp[0][0][0] = 1;
		for (int i = 0; i < n; i++){
			for (int j = 0; j < 300; j++){
				for (int k = 0; k < 2048; k++){
					if (dp[i][j][k]){
						for (int l = 0; l < 9; l++){
							if (~k & (1 << l)){
								dp[i + 1][j + (i + 1) * l][k | (1 << l)] += dp[i][j][k];
							}
						}
					}
				}
			}
		}
		
		int sum = 0;
		for (int i = 0; i < 2048; i++){
			sum += dp[n][s][i];
		}
		printf("%d\n", sum);
	}
	
	return 0;
}