#include <iostream>
#include <vector>
#include <map>
#include <utility>
using namespace std;

map<pair<pair<int,int>,int>,int> memo; 

int BT( int N, int S, int d, int p, int s )
{
	if ( d==N )
		return s==S ? 1 : 0;

	pair<pair<int,int>,int> k = make_pair(make_pair(d,p),s);
	if ( memo.count(k)>0 )
		return memo[k];
	int ans = 0;
	for ( int i=p; i<=S; i++ )
		ans += BT(N,S,d+1,i+1,s+i);
	return memo[k]=ans;
}

int main()
{
	while ( true )
	{
		memo.clear();
		int n, s;
		cin >> n>>s;
		if ( n ==0 && s==0 )
			break;

		cout << BT(n,s,0,0,0) << endl;

	}

	return 0;
}