Little Vasya has received a young builder’s kit. The kit consists of several wooden bars, the lengths of all of them are known. The bars can be put one on the top of the other if their lengths are the same.

Vasya wants to construct the minimal number of towers from the bars. Help Vasya to use the bars in the best way possible.

Input

The first line contains an integer N (1 ≤ N ≤ 1000) — the number of bars at Vasya’s disposal. The second line contains N space-separated integers li — the lengths of the bars. All the lengths are natural numbers not exceeding 1000.

Output

In one line output two numbers — the height of the largest tower and their total number. Remember that Vasya should use all the bars.

Examples

Input

3
1 2 3


Output

1 3


Input

4
6 5 6 7


Output

2 3
# # №1.1 Буква в слове
# a = input()
# s = list(input().split())
# l = len(s)
# for i in range(l):
#     if a in s[i]:
#         print(s[i])

# # №1.2 Максимальное кол-во букв в слове
# a = input().lower()
# max_c = 0
# for i in a:
#     if a.count(i) >= max_c:
#         max_c = a.count(i)
# print(max_c)

# # №1.3  Удалить каждый третий символ
# a = input()
# l = len(a)
# b = ''
# for i in range(l):
#     if i != 0 and i % 3 != 0:
#         b = b + a[i]
# print(b)

# # №1.4 Полицейские-рекруты
# c = int(input())
# h = list(map(int, input().split()))
# p_count = 0
# out = 0
# for i in h:
#     if i == -1:
#         if p_count == 0:
#             out += 1
#         else:
#             p_count -= 1
#     if 1 <= i <= 10:
#         p_count += i
# print(out)
# https://codeforces.com/problemset/problem/427/A

# # №1.5 A. I_love_%username%
# c = int(input())
# h = list(map(int, input().split()))
# count = 0
# min = h[0]
# max = h[0]
# for i in range(c):
#     if h[i] > max:
#         max = h[i]
#         count += 1
#     elif h[i] < min:
#         min = h[i]
#         count += 1
# print(count)
# https://codeforces.com/problemset/problem/155/A

# # №1.5 A. Следующий раунд
# n, k = map(int, input().split())
# h = list(map(int, input().split()))
# count = 0
# for i in range(n):
#     if h[i] >= h[k-1] and h[i] > 0:
#         count += 1
# print(count)
# https://codeforces.com/problemset/problem/158/A

# # №1.5.1 A. Праздник равенства
# n = int(input())
# h = list(map(int, input().split()))
# max_h = max(h)
# count = 0
# for i in range(n):
#     if h[i] < max_h:
#         r = max_h - h[i]
#         count += r
# print(count)
# https://codeforces.com/problemset/problem/758/A

# # №1.6 Тренировки Егора
# n = int(input())
# a = list(map(int, input().split()))
# count_chest = 0
# count_biceps = 0
# count_back = 0
# for i in range(n):
#     if i % 3 == 0:
#         count_chest += a[i]
#     elif i % 3 == 1:
#         count_biceps += a[i]
#     elif i % 3 == 2:
#         count_back += a[i]
#     else:
#         print('что то не так')
# if count_chest > count_biceps and count_chest > count_back:
#     print('chest')
# elif count_biceps > count_chest and count_biceps > count_back:
#     print('biceps')
# elif count_back > count_chest and count_back > count_biceps:
#     print('back')
# else:
#     print('сбой снова')
# https://codeforces.com/problemset/problem/255/A

# # №1.7 Упражнение на строки
# s = input().lower()
# glas = 'aoyeui'
# for i in glas:
#     s = s.replace(i,'')
# s = '.'.join(s)
# print('.' + s)
# https://codeforces.com/problemset/problem/118/A

# # №1.8 A. Не смешите мои подковы
# a = list(map(int, input().split()))
# count = 0
# while a:
#     c = a[0]
#     b = a.count(c)
#     count += b - 1
#     a.remove(c)
#     while c in a:
#         a.remove(c)
# print(count)
# # https://codeforces.com/problemset/problem/228/A

# # №1.9 B. Напитки
# c = int(input())
# h = list(map(int, input().split()))
# print(sum(h) / c)
# https://codeforces.com/problemset/problem/200/B

# # №1.10 A. Выбор команд
# n, k = map(int, input().split())
# y = list(map(int, input().split()))
# count = 0
# kom = 0
# for i in y:
#     if i <= 5 - k:
#         kom += 1
#     if kom == 3:
#         count += 1
#         kom = 0
# print(count)
# # https://codeforces.com/problemset/problem/432/A


# # №1.11 Decompress Run-Length Encoded List
# nums = list(map(int, input().split()))
# b = []
# len_nums = len(nums)
# eats = 0
# for i in range(1, len_nums, 2):
#     eats = nums[i]
#     for j in range(nums[i-1]):
#         b.append(eats)
# print(b)
# # https://leetcode.com/problems/decompress-run-length-encoded-list/

# # №1.12 A. Быстрый математик
# a = input()
# b = input()
# len_a = len(str(a))
# c = str(int(a) + int(b))
# while len(c) < len_a:
#     c = '0' + c
# # print(c, len(c), len_a)
# len_c = len(c)
# # print(c)
# for i in range(len_c):
#     if c[i] == '2':
#         c = c.replace(c[i], '0')
# # print(len(c), len_c)
# while len(c) < len_a:
#     c = '0' + c
# print(c)
# https://codeforces.com/problemset/problem/61/A

# №1.13 A. Ваня и забор
# n, h = map(int, input().split())
# a = list(map(int, input().split()))
# width = 0
# for i in range(n):
#     if a[i] <= h:
#         width += 1
#     else:
#         width += 2
# print(width)
# https://codeforces.com/problemset/problem/677/A

# №1.13 A. Башни
N = int(input())
L = list(map(int, input().split()))
max_count = 0
tower = []
for i in range(N):
    if L[i] not in tower:
        tower.append(L[i])
        if L.count(L[i]) > max_count:
            max_count = L.count(L[i])
print(max_count, len(tower))

# https://codeforces.com/problemset/problem/37/A
