#include <iostream>
using namespace std;
int co;

void solve(int d,int p,int n,int s){
  //cout<<s<<" "<<n<<" "<<d<<endl;
  if(n==1&&s>p)co++;
  if(n>1){
    for(int i=d;i<=s/n;i++){
      solve(i+1,i,n-1,s-i);
    }
  }
}

int main(){
  int n,s;
  while(cin>>n>>s &&(n||s)){
    co=0;
    if(n<=s)solve(0,0,n,s);
    cout<<co<<endl;
  }
  return 0;
}