Petya loves lucky numbers. We all know that lucky numbers are the positive integers whose decimal representations contain only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not.

Unfortunately, not all numbers are lucky. Petya calls a number nearly lucky if the number of lucky digits in it is a lucky number. He wonders whether number *n* is a nearly lucky number.
The only line contains an integer *n* (1 ≤ *n* ≤ 10<sup class="upper-index">18</sup>).

Please do not use the %lld specificator to read or write 64-bit numbers in С++. It is preferred to use the cin, cout streams or the %I64d specificator.
40047
NO
7747774
YES
1000000000000000000
NO
7
NO
4
NO
474404774
NO
4744000695826
YES
10000000004744744
YES
446486416781684178
YES
999999999
NO
7777
YES
87414417444
NO
111222333444555667
YES
1
NO
4700
NO
3794555488744477
NO
444444444444444444
NO
474447447774444774
NO
777777777777777
NO
34777745021000000
NO
963
NO
855474448854788540
NO
999999999999994744
YES
400000000474
YES
123456789123456789
YES
740577777584945874
NO
7777777
YES
4444000111222333
YES
9847745885202111
YES
123456000000
NO
4744447444444
NO
7477
YES
4747477
YES
777777777444444444
NO
x = input()
a = x.count('4')
b = x.count('7')
if (a+b) % 4 == 0 or (a + b) % 7 == 0:
    print("YES")
else:
    print("NO")
