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.
The single line contains two integers *l* and *r* (1 ≤ *l* ≤ *r* ≤ 10<sup class="upper-index">9</sup>) — the left and right interval limits.
2 7
33
7 7
7
1 9
125
4 7
25
12 47
1593
6 77
4012
1 100
14247
1000000000 1000000000
4444444444
77 77
77
69 788
452195
474 747
202794
4 77777
4070145675
1 1000000
1394675359387
47 744447
381286992761
47444 1000000000
1394672348253941136
48 854888
749733199853
854444 985555
582719941728
774744 774747
3098985
654 987654
1339803940266
477777 1000000000
1394672167300009765
77777 777777777
407018021649898097
963 85555574
7526978888069560
47 7444
38125896
1 1000000000
1394672350065645019
474 999888555
1394177038954402791
777 1000000000
1394672350065239125
7 777777774
407018023386632646
369 852
606732
47 47
47
747 748
1521
77777440 77777444
388887220
987545885 999875584
54798666661186800
2 777777776
407018024942188226
1 1
4
1 2
8
999999999 1000000000
8888888888
777777777 1000000000
987654325123456789
777777778 1000000000
987654324345679012
5 6
14
49 49
74
6 6
7
3 4
8

l,r = map(int, input().strip().split(' '))
#lst = list(map(int, input().strip().split(' ')))
S=0
c=0
for i in range(l,r+1):
    p=str(i)
    c1=p.count('4')
    c2=p.count('7')
    if c1+c2!=len(p):
        c+=1
        if i==r:
            for j in range(len(p)):
                if p[j]!='4' or p[j]!='7':
                    break
                else:
                    j+=1
            if j==0:
                if int(p[0])<4:
                    j1=int('4'*len(p))
                elif int(p[0])>7:
                    j1=int('4'*(len(p)+1)) 
                else:
                    j1=int('7'+'4'*(len(p)-1))
            else:
                if int(p[j])<4:
                    j1=int(p[:j]+'4'*len(p))
                elif int(p[j])>7:
                    if p[j-1]=='4':
                        j1=int(p[:j-1]+'7'+'4'*(len(p)-1))
                    else:
                        i1=j-1
                        while(i1>=0 and p[i1]!='4'):
                            i1-=1
                        if i1==0:
                            j1=int('4'*(len(p)+1)) 
                        else:
                            j1=int(p[:i1]+'7'+'4'*(len(p)-i1-1))
                else:
                    j1=int(p[:j]+'7'+'4'*(len(p)-1))
                
                
                
            
                
            
            S+=c*j1
    else:
        c+=1
        S+=c*i
        c=0
    
print(S)
        