#include <bits/stdtr1c++.h>

using namespace std;

typedef long double ld;
typedef long long ll;
typedef pair<ll, ll> pii;
typedef complex<ld> pt;

int main() {
	ios::sync_with_stdio(0);
	vector<ll> nums;
	for (ll i = 1; i <= 100000; i++) {
		ll t = i*(i+1)/2;
		ll x = sqrt(t+1) + 1e-5;
		if (x * x == t + 1) nums.push_back(t+1);
	}
	
	for (int i = 0; i < 10; i++) cerr << nums[i] << " ";
	cerr << endl;
	
	int a, b; 
	while (cin >> a >> b) {
		if (a+b == 0) break;
		int ans = lower_bound(nums.begin(), nums.end(), b) - lower_bound(nums.begin(), nums.end(), a+1);
		
		static int ca = 0;
		cout << "Case " << ++ca << ": ";
		cout << ans << endl;
	}
	return 0;
}