#Z16120. 素数回文数的个数

素数回文数的个数

Description

Find how many integers between 1111 and nn (inclusive) are both prime numbers and palindromic numbers.

Input Format

An integer nn such that 11<n<100011 < n < 1000.

Output Format

The number of palindromic primes between 1111 and nn.

Sample

23
1