#P2567. Approximate Lucky Numbers

    ID: 15836 Type: Default 1000ms 256MiB

Approximate Lucky Numbers

Approximate Lucky Numbers

In many parts of China, the digits 6 and 8 are considered lucky. Inspired by this belief, lxhgww defines a lucky number as any positive integer whose decimal representation contains only the digits 6 and 8. Examples of lucky numbers include 6, 8, 66, 68, 86, 88, etc. However, since there are few lucky numbers in a typical range, he further defines an approximate lucky number as any number that is divisible by at least one lucky number. Note that every lucky number is itself an approximate lucky number.

Given a closed interval [a, b], your task is to count how many approximate lucky numbers are present in that interval.

Constraints: 1 ≤ a ≤ b ≤ 100000

inputFormat

The input consists of a single line containing two space-separated integers a and b.

outputFormat

Output a single integer which is the count of approximate lucky numbers in the interval [a, b].

sample

1 100
26