#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, s, f = 0;
  while (scanf("%d%d%d", &n, &k, &s) && n != 0 && k != 0 && s != 0) {
    if (f == 1) {
      printf("\n");
    }
    f = 1;
    int ans = 0;
    for (int i = 1; i < 1 << n; i++) {
      int sum = 0, cnt = 0;
      for (int j = 0; j < n; j++) {
        if (i & (1 << j)) {
          sum += (j + 1);
          cnt++;
        }
      }
      if (cnt == k && sum == s) ans++;
    }
    printf("%d", ans);
  }
  return 0;
}
