fork download
  1. #include <algorithm>
  2. #include <iostream>
  3. #include <map>
  4. #include <vector>
  5. #include <cstdio>
  6.  
  7. using namespace std;
  8.  
  9. int main()
  10. {
  11. long long n; cin >>n;
  12. short c=0;
  13. while(n) {
  14. if( n%10==4 || n%10==7) c++;
  15. n /= 10;
  16. }
  17.  
  18. puts( (c==4||c==7)?"YES":"NO" );
  19.  
  20. }
Success #stdin #stdout 0s 3344KB
stdin
1000000000000000000
stdout
NO