v=[3,15,120,528,4095,17955,139128,609960,4726275,20720703,160554240,703893960]
t = 1
while True:
  a,b = [int(i) for i in raw_input().split()]
  if a == 0 and b == 0:
    break
  x = 0
  for i in v:
    if a < i+1 < b:
      x += 1
  print "Case {0}: {1}".format(t,x)
  t += 1