#include<stdio.h>
#include<algorithm>
using namespace std;
int main(){
	int a,b,c;
	while(scanf("%d%d%d",&a,&b,&c),a){
		int ret=0;
		for(int i=0;i<(1<<a);i++){
			if(__builtin_popcount(i)!=b)continue;
			int v=0;
			for(int j=0;j<a;j++)if(i&(1<<j))v+=j+1;
			if(v==c)ret++;
		}
		printf("%d\n",ret);
	}
}