#include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <stdlib.h>
#include <stdio.h>
#include <bitset>
#include <cstring>
using namespace std;
#define FOR(I,A,B) for(int I = (A); I < (B); ++I)
#define CLR(mat) memset(mat, 0, sizeof(mat))
typedef long long ll;
int n, k, s;
int calc(int x, int cnt, int sum) {
  if(cnt == k) {
    return sum == s;
  }
  if(sum > s) return 0;
  int ret = 0;
  FOR(i,x+1,n+1) {
    ret += calc(i, cnt + 1, sum + i);
  }
  return ret;
}
int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  while(cin>>n>>k>>s,n||k||s) {
    cout << calc(0, 0, 0) << endl;
  }
  return 0;
}