#include<bits/stdc++.h>
#define rep(i,n)for(ll i=0;i<n;i++)
using namespace std;
typedef long long ll;

int main() {
	int n, s;
	while (cin >> n >> s) {
		int ans = 0;
		rep(i, 1 << 10) {
			int sum = 0;
			int cnt = 0;
			rep(j, 10) {
				if ((i >> j) & 1) {
					sum += j;
					cnt++;
				}
			}
			if (cnt == n&&sum == s)ans++;
		}
		cout << ans << endl;
	}
}