Zoro while studying numbers, observed an interesting property. He found out that every number can be represented as powers of primes. Now getting bored from studying, he thought of having some fun and defined an Inversion Number.
An Inversion Number of a number is defined as interchanging the power of the prime with the prime number in the prime factorization of the number.
Eg: x
Inversion Number of x 9
Zoro likes a number who's inversion number is unity. He calls them Perfect Inversion Numbers.
Now Zoro wonders given a range L to R what are the number of perfect inversion numbers in that range.
Note
Inversion number of 0 is 0 and inversion number of 1 is 1.
Input
First line contains an integer T denoting the number of testcases. Next T lines contains 2 integers each the range L and R.
Output
The number of Perfect Inversion Number between the the range L and R (both inclusive).
Constraints:
NOTE Use Fast I/O
In the first case, , , Therefor the inversion number of all the 3 is 1. Therefore all the 3 have perfect inversion number.
Second case, Only 5 has a perfect inversion number. Therefore answer is 1.