#include <iostream>
#include <algorithm>
#include <cstring>

typedef long long ll;

ll dp[1005][10][105];

int s, n;

int main(){
	memset(dp, -1, sizeof(dp));
	dp[0][0][0] = 0;

	for (int i = 0; i < 1005; ++i){
		for (int j = 0; j < 10; ++j){
			for (int k = 0; k < 105; ++k){
				if (dp[i][j][k] == -1)continue;
				for (int l = k + 1; l < 105; ++l){
					if(i + l < 1005)dp[i + l][j + 1][l] = dp[i][j][k] + 1;
				}
			}
		}
	}

	while (true){
		std::cin >> s >> n;
		if (s == 0 && n == 0)break;
		ll sum = 0;
		for (int i = 0; i < 105; ++i)sum += (dp[n][s][i] < 0 ? 0 : dp[n][s][i]);
		std::cout << sum << std::endl;
	}
	return 0;
}