{"trustable":false,"sections":[{"title":"","value":{"format":"MD","content":"A prime number is a positive number, which is divisible by exactly two different integers.\nA digit prime is a prime number whose sum of digits is also prime. \n\nFor example the prime number 41 is a digit prime because 4 + 1 \u003d 5 and 5 is a prime number. 17 is not a digit prime because 1 + 7 \u003d 8, and 8 is not a prime number. In this problem your job is to find out the number of digit primes within a certain range less than 1000000.\n\n### **Input**\nFirst line of the input file contains a single integer $N$ that indicates the total number of inputs. Each of the next $N$ lines contains two integers $t_1$ and $t_2$.\n\n### **Output**\nFor each line of input except the first line produce one line of output containing a single integer that indicates the number of digit primes between t1 and t2 (inclusive).\n\n### **Constraints**\n$0 \u003c N ≤ 500000$\n$0 \u003c t_1 \\leq t_2 \u003c 1000000$"}},{"title":"Sample 1","value":{"format":"MD","content":"\u003ctable class\u003d\"vjudge_sample\"\u003e\n \u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n \u003c/thead\u003e\n \u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\n \u003cpre\u003e\n3 \n10 20 \n10 100 \n100 10000\n \u003c/pre\u003e\n \u003c/td\u003e\n \u003ctd\u003e\n \u003cpre\u003e\n1\n10\n576\n \u003c/pre\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003c/tbody\u003e\n\u003c/table\u003e"}}]}