#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef vector<int> vi;

#define endl '\n'

int main() {
	ios::sync_with_stdio(0);
	int vals[12] = {3,15,120,528,4095,17955,139128,609960,4726275,20720703,160554240,703893960};
	int a, b;
	int t = 1;
	while(cin >> a >> b) {
		if (a == 0 && b == 0) break;
		int ans = 0;
		for(int i=0; i<12; i++) {
			if ((vals[i]+1) > a && (vals[i]+1) < b) ans++;
		}
		cout <<"Case " << t << ": " << ans << endl;
		t++;
	}
	return 0;
}