Codeforces-SolutionsA/Codes/110 A - Nearly Lucky Number/110A.cpp

16 lines
265 B
C++
Raw Normal View History

2023-06-09 18:31:07 +08:00
#include<bits/stdc++.h>
using namespace std;
int main()
{
long long n;
int count=0;
cin>>n;
while(n!=0)
{
if(n%10==4 || n%10==7) count++;
n=n/10;
}
if(count==4 || count==7) cout<<"YES"<<endl;
else cout<<"NO"<<endl;
}