#include <bits/stdc++.h>
using namespace std;
int main() {
  int ans[21][11][156] = {0};
  int n, k, s;
  for (int i = 1; i < (1 << 20); i++) {
    bitset<20> foo(i);
    if (foo.count() <= 10) {
      int sum = 0;
      for (int j = 0; j < 20; j++)
        if (foo[j] == 1) sum += (j + 1);
      if (sum <= 155) {
        int j = 19;
        while (foo[j] != 1) {
          j--;
        }
        ans[j + 1][foo.count()][sum]++;
      }
    }
  }
  while (cin >> n >> k >> s && n) cout << ans[n][k][s] << endl;
  return 0;
}
