#include<iostream>
#include<vector>
#include<cstdio>
#include<cmath>
#include<cctype>
#include<climits>
#include<sstream>
#include<algorithm>
#include<cstdlib>
#include<cstring>
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 = 10;
const int S = 12;
const int S_MAX = 340;
const int P_MAX = (1 << N);

int n, s;
int dp[S + 1][S_MAX][P_MAX];

bool check(int n, int max){
    if(n < 0 || n >= max) return false;
    else return true;
}

void make_dp(){
    memset(dp, 0, sizeof(dp));
    for(int mask = 1, num = 0; mask < (1 << N); mask = (mask << 1), ++num){
        //debug
        //if(!check(num, S)) cout <<"!" <<endl;
        //if(!check(mask, P_MAX)) cout <<"!" <<endl;
        //debug end
        dp[1][num][mask] = 1;
    }

    FOR(i, 2, S + 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){
                        //debug
                        //if(!check(i, S)) cout <<"!" <<endl;
                        //if(!check(j, S_MAX)) cout <<"!" <<endl;
                        //if(!check(p, P_MAX)) cout <<"!" <<endl;
                        //if(!check(i - 1, S)) cout <<"!" <<endl;
                        //if(!check(j - (num * i), S_MAX)) cout <<"!" <<endl;
                        //if(!check(k, P_MAX)) cout <<"!" <<endl;
                        //debug end
                        dp[i][j][p] += dp[i - 1][j - (num * i)][k];
                    }
                }
            }
        }
    }
}

int main(){
    make_dp();
    while(cin >>n){
        cin >>s;
        int ans = 0;
        REP(i, P_MAX){
            //debug
            //if(!check(n, S)) cout <<"!" <<endl;
            //if(!check(s, S_MAX)) cout <<"!" <<endl;
            //if(!check(i, P_MAX)) cout <<"!" <<endl;
            //debug end
            ans += dp[n][s][i];
        }
        cout <<ans <<endl;
    }
    return 0;
}