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

int case_num = 0;
int cheatsheet[] = {3, 15, 120, 528, 4095, 17955, 139128, 609960, 4726275, 20720703, 160554240, 703893960};
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int a, b;
  while (cin >> a >> b && (a || b)) {
    int result = 0;
    for (int val : cheatsheet) {
      if ((val + 1 > a) && (val + 1 < b)) {
        result++;
      }
    }
    cout << "Case " << ++case_num << ": ";
    cout << result << '\n';
  }
  return 0;
}