#include <iostream>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cstdio>
#include <map>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,b) FOR(i,0,b)
#define PB push_back
#define MP make_pair
int s,n,ans=0;
void rec(int i,int sum){
  if(i==n&&sum==s){
    ans++;
    return;
  }
  if(i>=n||sum>=s)return;
  i++;
  for(int j=0;j<10;j++)rec(i,sum+i*j);
}
int main(){
  while(cin>>n>>s){
    ans=0;
    rec(0,0);
    cout<<ans<<endl;
  }
}