#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <time.h>
#include <math.h>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
#include <iterator>
#include <sstream>
#include <string>
#include <bitset>
using namespace std;
#define FOR(I,F,N) for(int I = F; I < (int)(N); I++)
#define rep(i, n) FOR(i, 0, n)
#define FIN(V) cout<<V<<endl
#define pb push_back
#define INF (1 << 28)

template<typename T>
void remove(vector<T>& vector, unsigned int index){
vector.erase(vector.begin() + index);
}

typedef pair<int, int> P;
typedef long long ll;
typedef priority_queue<int> pq;
int StrToInt(string);
string IntToStr(int);
int dx[4] = {1, -1, 0, 0};
int dy[4] = {0, 0, 1, -1};

//func(use, sum, )

int n, s;

int func(int use, int sum, int now){
	if(use == n){
		if(sum == s){
			return true;
		}else{
			return false;
		}
	}
	if(use > n || sum > s || now > 9)return false;

	return func(use+1, sum+now, now+1) + func(use, sum, now+1);
}

int main(void){

	int memo[100][100];
	rep(i, 9){
		rep(j, 55){
			n = i+1;
			s = j+1;
			memo[n][s] = func(0,0,0);

		}
	}

	while(cin >> n >> s){
		cout << memo[n][s] << endl;
	}

	return 0;
}



int StrToInt(string s){
	stringstream ss;
	ss << s;
	int val;
	ss >> val;
	return val;
}
string IntToStr(int i){
	stringstream ss;
	ss << i;
	return ss.str();
}