#include<iostream>

using namespace std;

int n, s;
int c = 0;
int i = 0;
int j = 0;
int q = 0;
int date[15] = { 0 };



int sub(int start,int n,int x){
	if (x == n){
		for (int i = 0; i < n; i++){
			j = i - 1;
			/*cout << date[i];*/
			if (j>0){
				date[i] += date[j];
			}
			if (i == n - 1&&date[i]==s){
				q++;
			}
		}
		return 0;
	}

	for (int i = start; i < 10;i++){

		date[x] = i;

		sub(i + 1, n, x + 1);
	
	}


}



int main(){

	n = 0;
	while (true){
		cin >> n >> s;
		sub(0, n, 0);


		cout << q << endl;
		q = 0;
	}
}