#include <iostream>
using namespace std;
int main()
{
unsigned numar, ciframax=0, nraparitii=0;
cout<<"Numarul="; cin>>numar;
while (numar)
{
if (numar%10>ciframax)
{
ciframax=numar%10;
nraparitii=1;
}
else if (numar%10==ciframax)
nraparitii++;
numar /= 10;
}
cout<<"Cifra maxima este "<<ciframax<<" si apare de "<<nraparitii<<" ori";
return 0;
}