number = input()
total = number.count("4") + number.count("7")
if total == 4 or total == 7:
    print("YES")
else:
    print("NO")
aeff43610b463e37fdcd4be68676fdf18b8859d0
<mask token>

<mask token>
if total == 4 or total == 7:
    print('YES')
else:
    print('NO')

number = input()
total = number.count('4') + number.count('7')
if total == 4 or total == 7:
    print('YES')
else:
    print('NO')

number = input()
total = number.count("4") + number.count("7")
if total == 4 or total == 7:
    print("YES")
else:
    print("NO")