시간 제한메모리 제한제출정답맞힌 사람정답 비율
12 초 (추가 시간 없음) 1024 MB4921107223.301%

문제

A prime number is an integer greater than 1 which is only divisible by the integers 1 and itself, and no other positive integers. A palindromic number is one that is the same when read forwards or backwards, when written with no leading zeros. A palindromic prime is a prime number that is also a palindrome. The first few palindromic primes are 2, 3, 5, 7, 11 and 101.

Given two integers, L and H, determine the number of palindromic primes that are between L and H, inclusive.

입력

The first and only input line will contain two space separated integers: L (2 ≤ L ≤ 1012) and H (L ≤ H ≤ 1012), the lower and upper bounds (inclusive) for the search.

출력

Print a single integer on a line by itself: the number of palindromic primes between L and H, inclusive.

예제 입력 1

2 101

예제 출력 1

6

예제 입력 2

238 382

예제 출력 2

3

예제 입력 3

93139 97879

예제 출력 3

15