#include <algorithm>
#include <iostream>
#include <limits.h>
#include <math.h>
#include <set>
#include <stack>
#include <stdlib.h>
#include <string>
#include <vector>

#define el endl
#define fd fixed
#define INF INT_MAX/2-1
#define pb push_back

using namespace std;

int func(int n, int k, int s, int count, int pre) {
  if (k == 0 && s == 0) return ++count;
  if (k == 0 && s != 0) return count;
  for (int i = pre+1; i <= n; i++) {
    count = func(n, k-1, s-i, count, i);
  }
  return count;
}

int main() {
  int n, k ,s;
  while (cin >> n >> k >> s, n | k | s) {
    cout << func(n, k ,s, 0, 0) << el;
  }
}