#include <iostream>
#include <string>
#include <algorithm>
#include <vector>

using namespace std;
int ans = 0,n;

void a( int t, int k, int s) {
 if (k==0&&s == 0) {
  ans++;
  return;
 }
 if (k == 0 || t > n)return;
 for (int i = t+1; i <= n; i++) {
  a( i, k - 1, s - i);
 }
 return;
}
int main() {
 int  k, s;
 while (1) {
  cin >> n >> k >> s;
  if (n == 0 && k == 0 && s == 0)break;
  ans = 0;
  a(0, k, s);
  cout << ans << endl;
 }
 return 0;
}
