Time

11:01:37
11 Feb 2012
ACM-ICPC Thailand Southern Region Programming Contest 2011
Left: 3 hours 59 minutes
End: 11.02.2012 15:00
Leader: Informatimukas
Five for week 22
Left: 10 hours 59 minutes
End: 11.02.2012 22:00
Leader: NuM
Version for print

"Mirror prime" numbers

prb22   We will call a number "mirror prime", if it is simple, and the number written down by those numbers in a back order is simple.

  On the set from A to B find the amount of "mirror prime" numbers.


Specifications

   Input

   On the entrance is given a 2 number À and Â. (1A, B10000)

   Output

   A singular is the sought after amount of "mirror prime" numbers.


Problem information

Time Limit: 1 seconds
Memory Limit: 64 MB
Balls for the passed test: 10
Complexity: 36% 421/662
My result: 0/1

Example

Example input

10 25

Example output

3


← Corruption Problems New-year tree →