#include<iostream>
#include<vector>
#include<cstdio>
#include<cmath>
#include<cctype>
#include<climits>
#include<sstream>
#include<algorithm>
using namespace std;
#define REP(i, j) for(int i = 0; i < j; i++)
#define FOR(i, j, k) for(int i = j; i < k; i++)
#define P pair<int, string>
const int INF = INT_MAX / 2;
const int N = 11;
const int S_MAX = 400;
const int P_MAX = (1 << N);

int n, s;

int check_bit_num(int bit){
    int ret = 0;
    for(int i = 1; i < (1 << N); i = (i << 1)){
        if((bit & i) != 0) ++ret;
    }
    return ret;
}

string disp(int n){
    stringstream ss;
    for(int i = 1; i < (1 << N); i = (i << 1)){
        if((n & i) != 0) ss <<1;
        else ss <<0;
    }
    string tmp = ss.str();
    reverse(tmp.begin(), tmp.end());
    return tmp;
}

int main(){
    vector< vector< vector<int> > > dp(N + 1, vector< vector<int> >(S_MAX, vector<int>(P_MAX, 0)));
    //初期化
    for(int mask = 1, num = 0; mask < (1 << N); mask = (mask << 1), ++num){
        dp[1][num][mask] = 1;
    }

    FOR(i, 2, N + 1){
        for(int mask = 1, num = 0; mask < (1 << N); mask = (mask << 1), ++num){
            FOR(j, num * i, S_MAX){
                for(int k = 1; k < (1 << N); ++k){
                    if((k & mask) != 0) continue;
                    int p = (k | mask);
                    if(j - (num * i) >= 0) dp[i][j][p] += dp[i - 1][j - (num * i)][k];
                    //debug
                    //if(dp[i][j][p] != 0) cout <<i <<" " <<j <<" " <<disp(p) <<" " <<dp[i][j][p] <<endl;
                }
            }
        }
    }




    //FOR(i, 1, N){
    //    REP(j, S_MAX){
    //        for(int mask = 1, num = 1; mask < (1 << N); mask = (mask << 1), ++num){
    //            dp[i][i * num][mask] += 1;
    //            //debug
    //            cout <<"! " <<i <<", " <<i * num <<", " <<mask <<endl;
    //            for(int k = 0; k < (1 << N); k++){
    //                if((k & mask) != 0) continue;
    //                int p = (k | mask);
    //                if(j - (num * i) >= 0) dp[i][j][p] = (dp[i - 1][j - (num * i)][k]) + 1;
    //                //debug
    //                if(j <= 7 && dp[i][j][p] != 0) cout <<dp[i][j][p] <<", " <<i <<", " <<j <<", " <<disp(mask) <<", " <<disp(k) <<", " <<disp(p) <<endl;
    //            }
    //        }
    //    }
    //}


    while(cin >>n){
        cin >>s;
        int ans = 0;
        REP(i, P_MAX){
            ans += dp[n][s][i];
        }
        cout <<ans <<endl;
    }
    return 0;
}