#include<iostream> using namespace std; int main() { int n,k=0,cmax=0; cin>>n; while(n>0) { if(n%10>cmax) { cmax=n%10; k=1; } else if(n%10==cmax) k++; n=n/10; } cout<<cmax<<" "<<k; return 0; }