Petya loves lucky numbers. Everybody knows that lucky numbers are positive integers whose decimal representation contains only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not.

Let next(x) be the minimum lucky number which is larger than or equals x. Petya is interested what is the value of the expression next(l) + next(l + 1) + ... + next(r - 1) + next(r). Help him solve this problem.

Input

The single line contains two integers l and r (1 ≤ l ≤ r ≤ 109) — the left and right interval limits.

Output

In the single line print the only number — the sum next(l) + next(l + 1) + ... + next(r - 1) + next(r).

Please do not use the %lld specificator to read or write 64-bit integers in C++. It is preferred to use the cin, cout streams or the %I64d specificator.

Examples

Input

2 7


Output

33


Input

7 7


Output

7

Note

In the first sample: next(2) + next(3) + next(4) + next(5) + next(6) + next(7) = 4 + 4 + 4 + 7 + 7 + 7 = 33

In the second sample: next(7) = 7
import java.io.*;
import java.lang.reflect.Array;
import java.util.*;
import static java.lang.Integer.min;
import static java.lang.Long.max;
import static java.lang.Long.min;

public final class Main {
        static FastScanner in=new FastScanner();
        static PrintWriter out=new PrintWriter(System.out);

        /*
        1. Never use sorting on 1-indexed array! or be very careful about negative values and stuff
        2. read the statement carefully!
        3. What about corner cases a=0?
        */

        public static void main(String[]args) {
                long l=in.nextLong(),r=in.nextLong();
                out.println(solve(r)-solve(l-1));
                out.close();
        }

        static long solve(long a){
                ArrayList<Long>A=new ArrayList<>();
                A.add(0L);
                for(int i=1;i<=10;i++){
                        for(int mask=0;mask<(1<<i);mask++){
                                long num=0;
                                long p=1;
                                for(int bit=0;bit<i;bit++){
                                        if(((1<<bit)&mask)!=0) num+=p*7;
                                        else num+=p*4;
                                        p*=10;
                                }
                                A.add( num);
                        }
                }

                long ans=0;
                for(int i=1;i<A.size();i++){
                        if(A.get(i-1)>=a)break;
                        ans+=A.get(i)*(min(a, A.get(i))-A.get(i-1));
                }

                return ans;
        }




        static long lcm(long a,long b, long c){
                return lcm(a,lcm(b,c));
        }
        static long lcm(long a,long b){
                return a*b/gcd(a,b);
        }
        static long gcd(long a,long b) {
                if (a == 0) return b;
                return gcd(b%a,a);
        }
        static void printArray(long[]a,int m){
                for (int i=m;i<a.length+m;i++)out.print(a[i]+" ");
                out.println();
        }
        static void printArray(int[]a,int m){
                for (int i=m;i<a.length+m;i++)out.print(a[i]+" ");
                out.println();
        }
        static void printArray(String[]a,int m){
                for (int i=m;i<a.length+m;i++)out.print(a[i]+" ");
                out.println();
        }
        static void printArray(double[]a,int m){
                for (int i=m;i<a.length+m;i++)out.print(a[i]+" ");
                out.println();
        }
        static void printArray(boolean[]a,int m){
                for (int i=m;i<a.length+m;i++)out.print(a[i]+" ");
                out.println();
        }
        static class Pair implements Comparable<Pair>{
                int first,second;
                public Pair(int a,int b) {
                        first=a;
                        second=b;
                }
                @Override
                public int compareTo(Pair o) {
                        return first-o.first;
                }
        }
        static class FastScanner{
                BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
                StringTokenizer st=new StringTokenizer("");
                String next(){
                        while(!st.hasMoreTokens())
                                try{
                                        st=new StringTokenizer(br.readLine());
                                }catch(IOException e){
                                        e.printStackTrace();
                                }
                        return st.nextToken();
                }
                int nextInt() {
                        return Integer.parseInt(next());
                }
                int[] nextArray(int n,int m) {
                        int[] a=new int[n+m];
                        for (int i=m;i<n+m;i++)a[i]=nextInt();
                        return a;
                }
                long nextLong() {
                        return Long.parseLong(next());
                }
                double nextDouble() {
                        return Double.parseDouble(next());
                }
        }
}