// Arup Guha
// 7/14/2010
// Solution to 2010 BHCSI Mock Contest #1 Problem: Packaging

import java.io.*;
import java.util.*;

public class pack {
	
	public static void main(String[] args) throws Exception {
		
		Scanner fin = new Scanner(new File("pack.in"));
		int numCases = fin.nextInt();
		
		// Go through each case.
		for (int loop=1; loop<=numCases; loop++) {
			
			int low = fin.nextInt();
			int high = fin.nextInt();
			int sum = 0;
			
			// Go through each number in the range.
			for (int check=low; check<=high; check++) {
				
				// See if check is composite.
				boolean comp = false;
				for (int tryval=2; tryval<check; tryval++)
					if (check%tryval == 0) // Found a factor.
						comp = true;
						
				// This will be true if the number we are checking is composite.
				if (comp)
					sum++;
				
			}
			
			// Output the answer.
			System.out.println("Case "+loop+": There are "+sum+" possible packaging options.");
		}
	}
}