struggling with this issue
https://codeforces.com/problemset/problem/110/A
this is my code
#include <iostream>
using namespace std;
int main() {
long n, c = 0;
bool lucky = true;
cin >> n;
for( ; n > 0 ; n /= 10) {
if(n%10 == 4 || n%10 == 7) {
c++;
}
}
for( ; c > 0 ; c /= 10) {
if(c%10 != 4 && c%10 != 7) {
lucky = false;
}
}
if(lucky)
cout << "YES";
else
cout << "NO";
}