#include <bits/stdc++.h>
#include <fstream>
using namespace std;
int main ()
{
	ifstream f("timmax.inp");
    long long n,i,max=-1000000,dem=0;
    int a[10000];
    f>>n;
    for (i=1;i<=n;i++)
    {
    	f>>a[i];
    }
    f.close();
    ofstream f1("timmax.out");
    for (i=1;i<=n;i++)
    {
    		if(a[i]>max)
     max=a[i];
    }
    for (i=1;i<=n;i++)
    {
    	if (a[i]==max)
     	dem++;

	}
    f1<<max<<' '<<dem;
    f1.close();
}
