#include <iostream>
using namespace std;

const int SIZE = 30;

int solve[SIZE+1][SIZE+1];

void buildTable()
{
  int i,j;
	for(i=0; i<=SIZE; i++) {
		solve[i][0] = i;
		solve[0][i] = 0;
	}
	for(i=1; i<=SIZE; i++)
		for(j=1; j<=SIZE; j++)
			solve[i][j] = solve[i-1][j] + solve[i-1][j-1] + 1;
}

int main(void)
{
	int g, l;
	int ncase = 0;

	buildTable();
	cin >> g >> l;
	while (g != 0 || l != 0) {
		ncase++;
		cout << "Case " << ncase << ": " << solve[g][l]<<endl;
//		if (l > 0)
//			cout << ", first guess = " << solve[g-1][l-1]+1 << endl;
//		else
//			cout << ", first guess = " << solve[g][l] << endl;
		cin >> g >> l;
	}
	return 0;
}
