#include<iostream>
#include<string.h>
using namespace std;

int numofbits(int bits) {
  bits = (bits & 0x55555555) + (bits >> 1 & 0x55555555);
  bits = (bits & 0x33333333) + (bits >> 2 & 0x33333333);
  bits = (bits & 0x0f0f0f0f) + (bits >> 4 & 0x0f0f0f0f);
  bits = (bits & 0x00ff00ff) + (bits >> 8 & 0x00ff00ff);
  return (bits & 0x0000ffff) + (bits >>16 & 0x0000ffff);
}

int main() {
  int n,s,dp[1024][400];
  memset(dp, 0, sizeof(dp));
  dp[0][0] = 1;
  for(int i=0; i<1024; ++i)
    for(int j=0; j<400; ++j)
      if(dp[i][j] != 0) {
	int t = numofbits(i)+1;
	for(int k=0; k<10; ++k)
	  if(!(1<<k & i)) {
	    if(j+t*k >= 400) break;
	    dp[i|1<<k][j+t*k] += dp[i][j];
	  }
      }

  while(cin>>n>>s) {
    int ans = 0;
    for(int i=0; s<400 && i<1024; ++i)
      if(numofbits(i) == n) ans += dp[i][s];
    cout<<ans<<endl;
  }
}