#include <iostream>
using namespace std;

int dfs(int n, int s, int i) {
     if (n == 0 && s == 0) return 1;
     if (s < i) return 0;
     else {
	  int res = 0;
	  res = res + dfs(n, s, i + 1);
	  res = res + dfs(n - 1, s - i, i + 1);    
	  return res;
     }
}

int main ()
{
     int n, s;
     while (cin >> n >> s, n)
	  cout << dfs(n,s,0) << endl;
     
     return 0;
}