#include <iostream>
using namespace std;
int main() {
int n ,x , tmp , C_high_score = 0 , C_low_score = 0 , high_score , low_score ;
cin >> n >> tmp;
high_score = tmp;
low_score = tmp;
for (int i = 1 ; i < n ; i ++){
cin >> x;
if (x > high_score){
high_score = x;
C_high_score+=1;
}
if (x < low_score){
low_score = x;
C_low_score+=1;
}
}
cout << C_high_score << " " << C_low_score;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKaW50IG1haW4oKSB7CiAgICBpbnQgbiAseCAsIHRtcCAgLCBDX2hpZ2hfc2NvcmUgPSAwICwgQ19sb3dfc2NvcmUgPSAwICwgaGlnaF9zY29yZSAsIGxvd19zY29yZSA7CiAgICBjaW4gPj4gbiA+PiB0bXA7CiAgICBoaWdoX3Njb3JlID0gdG1wOwogICAgbG93X3Njb3JlID0gdG1wOwogICAgZm9yIChpbnQgaSA9IDEgOyBpIDwgbiA7IGkgKyspewogICAgICAgIGNpbiA+PiB4OwogICAgICAgIGlmICh4ID4gaGlnaF9zY29yZSl7CiAgICAgICAgICAgIGhpZ2hfc2NvcmUgPSB4OwogICAgICAgICAgICBDX2hpZ2hfc2NvcmUrPTE7CiAgICAgICAgfQogICAgICAgIGlmICh4IDwgbG93X3Njb3JlKXsKICAgICAgICAgICAgbG93X3Njb3JlID0geDsKICAgICAgICAgICAgQ19sb3dfc2NvcmUrPTE7CiAgICAgICAgfQogICAgfQogICAgY291dCA8PCBDX2hpZ2hfc2NvcmUgPDwgIiAiIDw8IENfbG93X3Njb3JlOwogICAgcmV0dXJuIDA7Cn0=