#include using namespace std; int main() { map M; int N, A; cin >> N; while (cin >> A) M[A]++; int n = M.begin() -> second; if (M.size() == 2) cout << M.rbegin() -> second << " " << n; else if (A == (N - 1) * 2) cout << n << " " << 0; else cout << 0 << " " << n; cout << "\n"; }