#include <bits/stdc++.h>

using namespace std;
const int N = 12;
int n, s;
int ans = 0;
typedef pair <int, int> pii;
map <pii, int> m;

void bt(int sum, int index, int pos) {
	if(sum == 0 && pos == n) {
		ans++;
		return;
	}
    if(pos == n) return;
	if(sum < 0) return;
	for(int i = index; i <= s; i++) {
		bt(sum - i, i + 1, pos + 1);
	}
}



int main() {
	//freopen("in.txt", "r", stdin); freopen("out.txt", "w", stdout);
	ios_base::sync_with_stdio(false);cin.tie(NULL);
	while(true) {
	    cin >> n >> s;
	    if(!n && !s) return 0;
	    pii p = make_pair(n, s);
	    if(!m.count(p)){
	    	bt(s, 0, 0);
	    	m[p] = ans;
		}
	    else
	    	ans = m[p];
	    cout << ans << "\n";
	    ans = 0;
	}
    return 0;
}