#include <iostream>
using namespace std;

int solve(int i, int sum, int flag);

int s, n;
int main() {
   cin >> n >> s;
   s = solve(0, 0, -1);
   cout << s << endl;
   return 0;
}

int solve(int i, int sum, int flag) {
   int res = 0;
   if (i < n) {
      for (int k = 0; k < 10; k++){ 
	 if (flag >= k) continue;
	 res += solve(i + 1, sum + k, k);
      }
   }else if(sum == s){
      res++;
   }
   return res;
}