#include "bits/stdc++.h"

using namespace std;

typedef vector<int> vi;
typedef pair<int,int> pii;
typedef long long ll;

#define dump(x)  cerr << #x << " = " << (x) << endl
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(a)  (a).begin(),(a).end()
#define pb push_back
#define INF 999999999

int kai(int n){
    if(n==1)return 1;
    else return kai(n-1)*n;
}


int main(){
    int n,s;
    while(cin>>n>>s){
        map<pair<int,pii>,bool> mp;
        ll ans=0;
        vector<int> vec(10);
        rep(i,10)vec[i]=i;
        sort(all(vec));
        do{
            int sum=0;
            rep(i,n){
                sum+=vec[i];
            }
            if( sum==s && !mp[make_pair(vec[0],pii(vec[1],vec[2]))] ){
                mp[make_pair(vec[0],pii(vec[1],vec[2]))]=true;
                ans++;
            }
        }while( next_permutation(all(vec)) );
        cout<<ans/kai(n)<<endl;
    }
}