Prime palindromes#8289

Prime palindromes

1 second
64 megabytes
Medium

Count the number of prime palindromes in the interval from to (inclusive).

A palindrome is a number that reads the same forwards and backwards, for example, , , .

A prime number is a number that has exactly divisors.

Input

The input contains two integers and (0 \le a, b \le 10^7) given on a single line, separated by a space.

Output

Print the number of prime palindromes in the interval from to (inclusive).

Examples

Example 1

Loading
Loading