2004 - The Almost Lucky Numbers(Harder)

通过次数

0

提交次数

0

时间限制 : 3 秒 内存限制 : 128 MB

John and Brus believe that the digits 4 and 7 are lucky and all others are not. According to them, an almost lucky number is a number that contains at most one non-lucky digit in its decimal representation. Return the total number of almost lucky numbers between a and b, inclusive.

题目输入

Each line contains two integers a,b<=10^16

题目输出

For each line of input,output the total number of almost lucky numbers between a and b, inclusive.

输入/输出样例

输入格式

4 7
8 19

输出格式

4
4