#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cstring>
using namespace std;
int n,s;
int Sum_of_Integers(int i,int sum,int v);
int main(){
  while(1){
    cin >> n >> s;
    if(!n && !s)break;
    int k = Sum_of_Integers( 0 , 0 , -1 );
    if(k == 0){
      cout << k << endl;
    }else {
      cout << k << endl;
    }
  }
}
int Sum_of_Integers(int i,int sum,int v){
  int ret = 0;
  if(i > n || sum > s)return 0; // あふれたとき
  if(i == n && sum == s)return 1;
  for(int j=v+1;j<=s;j++){
    if(sum+j<=s)ret += Sum_of_Integers( i + 1, sum + j , j );
  }
  return ret;
}