#include using namespace std; int main(){ ios_base::sync_with_stdio(false); cin.tie(nullptr); int N; cin >> N; map M; while(N--){ int a; cin >> a; M[a]++; } if(M.size() == 1){ auto [k,v] = *M.begin(); if(v*2-2 == k) cout << v << " " << 0 << endl; else cout << 0 << " " << v << endl; } else{ auto [ign,v0] = *M.begin(); auto [IGN,v1] = *M.rbegin(); cout << v1 << " " << v0 << endl; } }