EasyRating 900
Count Lucky Digits
Lucky digits are 4 and 7. Print how many of the digits of n are lucky, then YES if that count is itself a lucky number (made only of 4s and 7s), otherwise NO.
Input
One integer n (1 ≤ n ≤ 10¹⁸).
Output
The count and YES/NO.
Sample 1
Input
40047
Output
3 NO
Sample 2
Input
7747774
Output
7 YES
Output appears here