#include <bits/stdc++.h>
using namespace std;

int n;
int k;
int s;
int ans;

void Rec(int idx, int total, int num) {
  if (num == k) {
    if (total == s) ans++;
    return;
  }

  if (idx > n) return;

  for (int i=idx; i<=n; i++) {
    Rec(i+1, total+i, num+1);
  }
}

int main() {
  while (1) {
    scanf("%d%d%d", &n, &k, &s);
    if ((n|k|s) == 0) return 0;

    ans = 0;
    Rec(1, 0, 0);
    printf("%d\n", ans);
  }
}