Time

10:47:34
11 Feb 2012
ACM-ICPC Thailand Southern Region Programming Contest 2011
Left: 4 hours 13 minutes
End: 11.02.2012 15:00
Leader: Informatimukas
Five for week 22
Left: 11 hours 13 minutes
End: 11.02.2012 22:00
Leader: NuM
Version for print

The favorite numbers of Santa Cl

prb33    Santa Claus liked play with numbers and figures. most of all he liked a number 1, however 1.01 begins New Year.

   Years passed, but he stayed be of superstitious – he didn’t like numbers, in which 3 stand after 1, I mean it create 13 number. On New Year he decided give new problem: count, how many favorite simple numbers of Santa Claus which contains on interval [À, Â]?


Specifications

   Input

   One line, which contains 2 numbers: start and finish of interval. 1À, Â ≤ 500000.

   Output

   One number is quantity of favorite simple numbers of Santa Claus.


Problem information

Time Limit: 1 seconds
Memory Limit: 64 MB
Balls for the passed test: 8.33333
Complexity: 42% 251/433
Classes: Number theory

Example

Example input

9 23

Example output

4


← Queen and pawn Problems The word of sponsor →