import java.util.Scanner;

public class G {
	public static void main (String [] args){
		Scanner scan = new Scanner (System.in);
		int testNo = 1;
		while (true){
			long a = scan.nextLong() - 1;
			long b = scan.nextLong() - 1;
			
			if (a == -1 && b == -1){
				break;
			}
			
			int total = 0;
			
			for (int i = 1; i < 50000; i++){
				long num = i * (i + 1) / 2;
				if (num < b && num > a){
					num++;
					if (Math.abs(Math.sqrt(num) - (int)(Math.sqrt(num))) < 0.000001){
						total ++;
					}
				}
			}
			System.out.println("Case " + testNo + ": "+ total);
			testNo++;
		}
		scan.close();
	}
}