#include <bits/stdc++.h>
using namespace std;
int BT(int N, int S, int d, int p, int s) {
  if (d == N) return s == S ? 1 : 0;
  int ans = 0;
  for (int i = p; i <= S; i++) ans += BT(N, S, d + 1, i + 1, s + i);
  return ans;
}
int main() {
  while (true) {
    int n, s;
    cin >> n >> s;
    if (n == 0 && s == 0) break;
    cout << BT(n, s, 0, 0, 0) << endl;
  }
  return 0;
}
