#include<iostream>
#include<algorithm>
#include<cstring>
#include<cstdio>
#define INF 1111111
using namespace std;
int dp[10][1001]; // [後何個か][残りの合計]
int solve(int i,int sum,int v);
int main(){
  int n,s;
  while(1){
  cin >> n >> s;
  if(!n && !s)break;
  cout << solve( n , s , INF ) << endl;
  }
}
int solve(int i,int sum,int v){
  int ret = 0;
  if(i == 0 && sum == 0)return 1;
  if(sum<0 || i<0)return 0;
  if(dp[i][sum] != 0)return dp[i][sum];
  for(int j=sum;j>=0;j--){
    if(v>j)ret += solve( i - 1 , sum - j , j );
  }
  return dp[i][sum] = ret;
}