# -*- coding: utf-8 -*- """ No.112 ややこしい鶴亀算 https://yukicoder.me/problems/no/112 """ import sys from sys import stdin from collections import Counter input = stdin.readline def main(args): N = int(input()) numbers = [int(x) for x in input().split()] c = Counter(numbers).most_common() # カウント数を集計する animal1_count = c[0][1] count1 = c[0][0] if len(c) == 1: # カウント数が1種類しか無い場合、鶴か亀のどちらかしかいない if count1 + 2 == 2 * animal1_count: # 自分の足の数を2にして辻褄が合うようであれば鶴のみ、それ以外なら亀のみ print(animal1_count, 0) else: print(0, animal1_count) else: animal2_count = c[1][1] count2 = c[1][0] if count1 > count2: # 2種類のカウントがある場合、鶴のカウントの方が2だけ大きくなる print(animal1_count, animal2_count) else: print(animal2_count, animal1_count) if __name__ == '__main__': main(sys.argv[1:])