#include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
vector<int> nums(N);
for(int i = 0; i < N; i++) {
cin >> nums[i];
}
int min_val = *min_element(nums.begin(), nums.end());
int max_val = *max_element(nums.begin(), nums.end());
int max_count = count(nums.begin(), nums.end(), max_val);
cout << min_val << " " << max_count << endl;
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgbWFpbigpIHsKICAgIGludCBOOwogICAgY2luID4+IE47CiAgICB2ZWN0b3I8aW50PiBudW1zKE4pOwogICAgZm9yKGludCBpID0gMDsgaSA8IE47IGkrKykgewogICAgICAgIGNpbiA+PiBudW1zW2ldOwogICAgfQogICAgaW50IG1pbl92YWwgPSAqbWluX2VsZW1lbnQobnVtcy5iZWdpbigpLCBudW1zLmVuZCgpKTsKICAgIGludCBtYXhfdmFsID0gKm1heF9lbGVtZW50KG51bXMuYmVnaW4oKSwgbnVtcy5lbmQoKSk7CiAgICBpbnQgbWF4X2NvdW50ID0gY291bnQobnVtcy5iZWdpbigpLCBudW1zLmVuZCgpLCBtYXhfdmFsKTsKICAgIGNvdXQgPDwgbWluX3ZhbCA8PCAiICIgPDwgbWF4X2NvdW50IDw8IGVuZGw7CiAgICByZXR1cm4gMDsKfQo=