Subnumbers

We say that X is a subnumber of N if X can be obtained from N by removing some (possibly none) of its digits.
For instance, the subnumbers of 423 are [2, 3, 4, 23, 42, 43, 423], while the subnumbers of 777 are [7, 77, 777].

A number is special if all of its subnumbers are prime. Given an interval [a, b], find how many special numbers it contains.

Input

Two space-separated integers: a and b.

Output

A single integer: the number of special numbers in the interval [a, b].

Constraints

  • 1 ≤ a ≤ b ≤ 109
  • 1 is not a prime number.

Sample

InputOutputExplanation
20 301 The only special number contained in the interval is 23.
Questions?

Sponsors Gold