AtCoder Beginner Contest 064 - Colorful Leaderboard

In AtCoder, a person who has participated in a contest receives a color, which corresponds to the person's rating as follows:  
 - Rating 1-399 : gray
 - Rating 400-799 : brown
 - Rating 800-1199 : green
 - Rating 1200-1599 : cyan
 - Rating 1600-1999 : blue
 - Rating 2000-2399 : yellow
 - Rating 2400-2799 : orange
 - Rating 2800-3199 : red
Other than the above, a person whose rating is 3200 or higher can freely pick his/her color, which can be one of the eight colors above or not.

Currently, there are N users who have participated in a contest in AtCoder, and the i-th user has a rating of a_i.

Find the minimum and maximum possible numbers of different colors of the users.  

-----Constraints-----
 - 1 ≤ N ≤ 100
 - 1 ≤ a_i ≤ 4800
 - a_i is an integer.

-----Input-----
Input is given from Standard Input in the following format:
N
a_1 a_2 ... a_N

-----Output-----
Print the minimum possible number of different colors of the users, and the maximum possible number of different colors, with a space in between.  

-----Sample Input-----
4
2100 2500 2700 2700

-----Sample Output-----
2 2

The user with rating 2100 is "yellow", and the others are "orange". There are two different colors.

Difficulty: EASY

Starter code:

Solutions:
(n, *a) = map(int, open(0).read().split())
l = [i // 400 for i in a if i < 3200]
k = len(set(l))
print(k or 1, n - len(l) + k)


N = int(input())
R = list(map(int, input().split()))
X = [0] * 8
p = 0
for r in R:
	if r >= 3200:
		p += 1
	else:
		X[r // 400] = 1
s = sum(X)
if s == 0:
	print(str(1) + ' ' + str(p))
else:
	print(str(s) + ' ' + str(s + p))


N = int(input())
a = list(map(int, input().split()))
mini = 0
color_list = []
for i in a:
	if i // 400 < 8 and (i // 400 in color_list) == False:
		mini += 1
		color_list.append(i // 400)
maxi = mini
for j in a:
	if j >= 3200:
		maxi += 1
if mini == 0:
	mini = 1
print(mini, maxi)


n = int(input())
A = list(map(int, input().split()))
c = [0] * 10
add = 0
for i in range(n):
	if A[i] >= 3200:
		add += 1
		continue
	a = A[i] // 400
	c[a] = 1
print(max(sum(c), 1), sum(c) + add)


n = int(input())
a = list(map(int, input().split()))
color = [0] * 9
for i in a:
	if i // 400 <= 7:
		color[i // 400] += 1
	else:
		color[8] += 1
m = 8 - color[:8].count(0)
M = m + color[8]
if m == 0:
	m = 1
print(m, M)


N = int(input())
a = map(int, input().split())
c = 0
s = set()
for i in a:
	if i >= 3200:
		c += 1
	else:
		s.add(i // 400)
print(max(1, len(s)), len(s) + c)


n = int(input())
a = [int(_) for _ in input().split()]
rate = len(set([ai // 400 for ai in a if ai < 3200]))
count_master = len([ai for ai in a if ai >= 3200])
print(max(rate, 1), rate + count_master)


import collections as c
input()
a = c.Counter((i // 400 for i in [*map(int, input().split())]))
(b, c) = (len(set([i for i in a.keys() if i < 8])), sum([j for (i, j) in a.items() if i >= 8]))
print([b, 1][b == 0], b + c)


n = int(input())
a = list(map(int, input().split()))
cnt = 0
l = []
for i in a:
	p = i // 400
	if p <= 7:
		l.append(p)
	else:
		cnt += 1
d = len(set(l))
if d != 0:
	print(d, d + cnt)
else:
	print(1, cnt)


n = int(input())
rates = map(int, input().split())
colors = set()
over = 0
for rate in rates:
	if 1 <= rate and rate <= 399:
		colors.add('1-399')
	if 400 <= rate and rate <= 799:
		colors.add('400-799')
	if 800 <= rate and rate <= 1199:
		colors.add('800-1199')
	if 1200 <= rate and rate <= 1599:
		colors.add('1200-1599')
	if 1600 <= rate and rate <= 1999:
		colors.add('1600-1999')
	if 2000 <= rate and rate <= 2399:
		colors.add('2000-2399')
	if 2400 <= rate and rate <= 2799:
		colors.add('2400-2799')
	if 2800 <= rate and rate <= 3199:
		colors.add('2800-3199')
	if 3200 <= rate:
		over += 1
min = len(colors)
max = min + over
if min == 0:
	min = 1
print(min, max)


input()
color = [0] * 8
gold = 0
for a in map(int, input().split()):
	if a >= 3200:
		gold += 1
	else:
		color[a // 400] = 1
print(max(sum(color), 1), sum(color) + gold)


N = int(input())
A = [int(T) for T in input().split()]
Color = [T // 400 for T in A if T < 3200]
ColL = len(Color)
SetL = len(set(Color))
MIN = max(1, SetL)
MAX = SetL + (N - ColL)
print('{} {}'.format(MIN, MAX))


n = int(input())
a = list(map(int, input().split()))
for i in range(n):
	a[i] = min(a[i], 3200) // 400
m = a.count(8)
s = set(a)
s.discard(8)
print(max(1, len(s)), len(s) + m)


N = int(input())
A = list(map(int, input().split()))
L = []
H = []
for i in range(N):
	a = A[i] // 400
	if a > 7:
		H.append(a)
	else:
		L.append(a)
if len(L) != 0:
	print(str(len(set(L))) + ' ' + str(len(set(L)) + len(H)))
else:
	print('1 ' + str(len(H)))


(n, *a) = map(int, open(0).read().split())
l = [i // 400 for i in a if i < 3200]
c = len(set(l))
print(max(1, c), c + n - len(l))


N = int(input())
a = list(map(int, input().strip().split()))
c = [0 for n in range(8)]
f = 0
for n in range(N):
	tmp = a[n] // 400
	if tmp >= 8:
		f += 1
	elif c[tmp] == 0:
		c[tmp] += 1
MIN = max(sum(c), 1)
MAX = sum(c) + f
print(str(MIN) + ' ' + str(MAX))


n = int(input())
a = list(map(int, input().split()))
s = set()
fr = 0
for i in a:
	x = i // 400
	if x < 8:
		s.add(x)
	else:
		fr += 1
ki = len(s)
ma = ki + fr
mi = max(ki, 1)
print(mi, ma)


N = int(input())
A = list(map(int, input().split()))
A = [a // 400 for a in A]
l = len({0, 1, 2, 3, 4, 5, 6, 7} & set(A))
S = sum((a > 7 for a in A))
print(max(l, 1), l + S)


from collections import Counter
input()
c = Counter([min(int(i) // 400, 8) for i in input().split()])
lt3200 = [bool(c[i]) for i in range(8)].count(True)
print(max(1, lt3200), lt3200 + c[8])


N = int(input())
a = [int(v) for v in input().split(' ')]
l = [0] * 9
for i in range(N):
	rate = a[i]
	if rate < 400:
		l[0] += 1
	elif rate < 800:
		l[1] += 1
	elif rate < 1200:
		l[2] += 1
	elif rate < 1600:
		l[3] += 1
	elif rate < 2000:
		l[4] += 1
	elif rate < 2400:
		l[5] += 1
	elif rate < 2800:
		l[6] += 1
	elif rate < 3200:
		l[7] += 1
	else:
		l[8] += 1
uniq_n = 0
for i in range(8):
	if l[i] != 0:
		uniq_n += 1
min_v = 1 if uniq_n == 0 else uniq_n
max_v = uniq_n + l[8]
print(min_v, max_v)


n = int(input())
a = list(map(int, input().split()))
cnt = [0] * 9
for i in a:
	x = min(i // 400, 8)
	if x >= 8:
		cnt[8] += 1
	else:
		cnt[x] = 1
if sum(cnt[:8]) == 0:
	l = 1
	r = cnt[8]
else:
	l = sum(cnt[:8])
	r = l + cnt[8]
print(l, r)


import numpy as np
N = int(input())
a = np.array(list(map(int, input().split())))
a = a // 400
over_3200 = a[np.where(a >= 8)]
num_3200 = len(over_3200)
a = a[np.where(a <= 7)]
a_list = np.unique(a)
len_a = len(a_list)
if len_a == 0:
	min = 1
	num_3200 -= 1
else:
	min = len_a
max = min + num_3200
print(min, max)


v = [0] * 9
n = int(input())
a = list(map(int, input().split()))
for i in a:
	idx = i // 400
	if idx >= 8:
		idx = 8
	v[idx] += 1
r = 0
for i in range(8):
	if v[i] >= 1:
		r += 1
print(max(1, r), r + v[8])


N = int(input())
A = list(map(int, input().split()))
B = [s // 400 for s in A if s < 3200]
C = len(set(B))
print(C or 1, N - len(B) + C)


n = int(input())
a = list(map(int, input().split()))
r = [0] * 8
f = 0
for i in range(n):
	if a[i] >= 3200:
		f += 1
	else:
		r[a[i] // 400] = 1
c = sum(r)
print(1 if c == 0 else c, end=' ')
print(f + c)


N = int(input())
p = list(map(int, input().split()))
s = set()
z = 0
for i in range(N):
	p[i] //= 400
	if p[i] < 8:
		s.add(p[i])
	else:
		z += 1
print(max(1, len(s)), end=' ')
print(len(s) + z)


n = int(input())
a = list(map(lambda x: min(8, int(x) // 400), input().split()))
cnt = 0
for i in a:
	if i >= 8:
		cnt += 1
c = len(set(a)) - (1 if cnt != 0 else 0)
print(max(1, c), c + cnt)


n = int(input())
a = list(map(lambda x: min(int(x) // 400, 8), input().split()))
cat = [0] * 8
f = 0
for ai in a:
	if ai < 8:
		cat[ai] = 1
	if ai == 8:
		f += 1
print(str(max(sum(cat), 1)) + ' ' + str(sum(cat) + f))


n = int(input())
a = map(lambda x: int(x) // 400, input().split())
b = set()
c = 0
for v in a:
	if v >= 8:
		c += 1
	else:
		b.add(v)
if len(b) == 0:
	print('1 ' + str(c))
else:
	print(str(len(b)) + ' ' + str(len(b) + c))


n = int(input())
a = list(map(int, input().split()))
count = 0
ans = 1
color_lis = [0, 0, 0, 0, 0, 0, 0, 0]
for i in range(n):
	if a[i] // 400 >= 8:
		count += 1
	else:
		color_lis[a[i] // 400] = 1
ans = sum(color_lis)
if count > 0:
	flag = 1
else:
	flag = 0
ans1 = max(flag, ans)
ans2 = ans + count
print(ans1, ans2)


N = int(input())
A = list(map(int, input().split()))
C = [a // 400 for a in A]
mini = sum([1 for c in range(8) if c in C])
print(max(mini, 1), mini + sum([1 for c in C if c >= 8]))


N = int(input())
L = list(map(int, input().split()))
L = [i // 400 for i in L]
a = [i for i in L if i < 8]
b = [i for i in L if i > 7]
a = len(set(a))
b = len(b)
if a == 0:
	mi = 1
	ma = b
else:
	mi = a
	ma = mi + b
print(mi, ma)


N = int(input())
all = 0
colors = [0] * 8
for a in map(int, input().split()):
	if a >= 3200:
		all += 1
	else:
		colors[a // 400] = 1
print(max(sum(colors), 1), sum(colors) + all)


n = int(input())
a = list(map(int, input().split()))
s = [0] * 8
c = 0
for ai in a:
	if ai < 3200:
		s[ai // 400] = 1
	else:
		c += 1
ssum = sum(s)
smin = max(1, ssum)
smax = ssum + c
print(smin, smax)


n = int(input())
a = list(map(int, input().split()))
c = [0] * 8
d = 0
for x in a:
	for i in range(8):
		if x < 400 * (i + 1):
			c[i] = 1
			break
	if x >= 3200:
		d += 1
s = sum(c)
print(max(s, 1), s + d)


n = int(input())
a = list(map(int, input().split()))
arr = [0] * 9
ans = [0] * 2
for i in a:
	if i // 400 < 8:
		arr[i // 400] = 1
	else:
		arr[8] += 1
left = sum(arr[:8])
right = arr[8]
ans[0] = left
if left == 0:
	ans[0] = 1
ans[1] = left + right
print(*ans)


n = int(input())
l = list(map(int, input().split()))
n_o = len([i for i in l if i >= 3200])
n_c = len(set([i // 400 for i in l if i < 3200]))
print(max(1, n_c), n_o + n_c)


import sys
from io import StringIO
import unittest

class TestClass(unittest.TestCase):

	def assertIO(self, input, output):
		(stdout, stdin) = (sys.stdout, sys.stdin)
		(sys.stdout, sys.stdin) = (StringIO(), StringIO(input))
		resolve()
		sys.stdout.seek(0)
		out = sys.stdout.read()[:-1]
		(sys.stdout, sys.stdin) = (stdout, stdin)
		self.assertEqual(out, output)

	def test_入力例_1(self):
		input = '4\n2100 2500 2700 2700'
		output = '2 2'
		self.assertIO(input, output)

	def test_入力例_2(self):
		input = '5\n1100 1900 2800 3200 3200'
		output = '3 5'
		self.assertIO(input, output)

	def test_入力例_3(self):
		input = '20\n800 810 820 830 840 850 860 870 880 890 900 910 920 930 940 950 960 970 980 990'
		output = '1 1'
		self.assertIO(input, output)

def resolve():
	N = int(input())
	A = list(map(int, input().split()))
	C = [0] * 9
	for a in A:
		for i in range(8):
			if 400 * i <= a <= 400 * i + 399:
				C[i] = 1
				break
		else:
			C[8] += 1
	print(f'{max(1, C[:8].count(1))} {C[:8].count(1) + C[8]}')

def __starting_point():
	resolve()
__starting_point()


N = int(input())
a = [int(i) for i in input().split()]
rates = [0] * 9
for rate in a:
	rates[min(rate // 400, 8)] += 1
ans = 0
for color in rates[:8]:
	ans += color != 0
ansmax = ans + rates[8]
print(max(ans, 1), ansmax)


n = int(input())
A = list(map(int, input().split()))
C = [0] * 8
free = 0
for a in A:
	if a >= 3200:
		free += 1
	else:
		C[a // 400] = 1
print(max(1, sum(C)), sum(C) + free)


N = int(input())
a = list(map(int, input().split()))
b = [0] * 8
f = 0
for i in a:
	if i // 400 <= 7:
		b[i // 400] = 1
	else:
		f += 1
sb = sum(b)
print(max(sb, 1), sb + f)


n = int(input())
a = list(map(int, input().split()))
free = 0
color = set()
for i in a:
	if i >= 3200:
		free += 1
	else:
		color.add(i // 400)
print(max(1, len(color)), len(color) + free)


N = int(input())
A = list(map(int, input().split()))
cin = [0, 0, 0, 0, 0, 0, 0, 0]
kin = 0
pin = 0
flag = 0
for i in A:
	if i < 3200:
		cin[i // 400] += 1
		pin = 1
	else:
		kin += 1
		flag = 1
if pin == 0:
	print(1, kin)
else:
	print(8 - cin.count(0), 8 - cin.count(0) + kin)


n = int(input())
a = list(map(int, input().split()))
cnt = [0] * 9
for i in a:
	cnt[min(i, 3200) // 400] += 1
print(max(len(cnt) - cnt.count(0) - min(cnt[-1], 1), 1), len(cnt) - cnt.count(0) + max(0, cnt[-1] - 1))


N = int(input())
(*A,) = map(int, input().split())
s = list(map(lambda x: x // 400, A))
mm = len(set([i for i in s if i < 8]))
o = len([i for i in s if 8 <= i])
print(mm if 1 <= mm else 1, min(N, mm + o))


n = int(input())
a = [int(i) for i in input().split()]
iro = [0 for i in range(8)]
tyi = 0
for i in range(n):
	if a[i] < 3200:
		iro[int(a[i] / 400)] = 1
	else:
		tyi += 1
print(max(iro.count(1), 1), iro.count(1) + tyi)


input()
l = [0] * 8
c = 0
for i in map(int, input().split()):
	i //= 400
	if i < 8:
		l[i] = 1
	else:
		c += 1
s = sum(l)
print(max(s, 1), s + c)


N = int(input())
a = list(map(int, input().split()))
rate = set()
over = 0
for ai in a:
	if ai >= 3200:
		over += 1
	else:
		rate.add(ai // 400)
L = len(rate)
print(max(1, L), L + over)


N = int(input())
a = list(map(int, input().split()))
color = set()
rainbow = 0
for n in range(N):
	if 1 <= a[n] < 400:
		color.add('gray')
	elif 400 <= a[n] < 800:
		color.add('brown')
	elif 800 <= a[n] < 1200:
		color.add('green')
	elif 1200 <= a[n] < 1600:
		color.add('water')
	elif 1600 <= a[n] < 2000:
		color.add('blue')
	elif 2000 <= a[n] < 2400:
		color.add('yellow')
	elif 2400 <= a[n] < 2800:
		color.add('orange')
	elif 2800 <= a[n] < 3200:
		color.add('red')
	else:
		rainbow += 1
if len(color) == 0:
	color_min = 1
	color_max = rainbow
else:
	color_min = len(color)
	color_max = color_min + rainbow
print(f'{color_min} {color_max}')


N = int(input())
A = list(map(int, input().split()))
cs = set()
free = 0
for a in A:
	if a < 3200:
		cs.add(a // 400)
	else:
		free += 1
print(max(1, len(cs)), len(cs) + free)


(N,) = list(map(int, input().split()))
a = list(map(int, input().split()))
s = set()
c6 = 0
for ai in a:
	if ai >= 3200:
		c6 += 1
	else:
		s |= set({ai // 400})
print(max(1, len(s)), len(s) + c6)


n = int(input())
a = list(map(int, input().split()))
b = 0
for i in range(n):
	if a[i] // 400 >= 8:
		b += 1
c = [s // 400 for s in a if s < 3200]
C = len(set(c))
print(C or 1, C + b)


N = int(input())
a = list(map(int, input().split()))
b = []
j = 0
for i in a:
	if i < 3200:
		b.append(int(i / 400))
	if i >= 3200:
		j += 1
k = len(set(b))
if k == 0 and j > 0:
	k = 1
	j = j - 1
print(k, k + j)


n = int(input())
a = list(map(int, input().split()))
x = [0] * 9
for i in a:
	x[min(i // 400, 8)] += 1
ans = 0
for i in range(8):
	if x[i] > 0:
		ans += 1
mini = max(1, ans)
maxe = ans + x[8]
print(mini, maxe)


def resolve():
	n = input()
	c = [False] * 8
	p = 0
	for i in list(map(int, input().split())):
		if i >= 3200:
			p += 1
		else:
			c[i // 400] = True
	print(sum(c) or 1, sum(c) + p)
resolve()


input()
A = map(int, input().split())
C = [0] * 99
D = 0
for a in A:
	a //= 400
	D += a > 7
	C[a] = a < 8
E = sum(C)
print(max(E, 1), E + D)


li = [0] * 8
o = 0
(n, *a) = map(int, open(0).read().split())
for i in a:
	if i >= 3200:
		o += 1
	else:
		li[i // 400] = 1
if sum(li) == 0:
	print(1, min(o, 8))
else:
	print(sum(li), sum(li) + o)


n = int(input())
a = list(map(int, input().split()))
b = set()
d = 0
for i in a:
	c = i // 400
	if c < 8:
		b.add(c)
	else:
		d += 1
print(max(len(b), 1), len(b) + d)


N = int(input())
c = [0] * 9
for a in map(int, input().split()):
	c[min(a // 400, 8)] += 1
csum = sum(map(bool, c[:8]))
print(max(csum, 1), csum + c[8])


def cordtest(AAA):
	jisyo = {'H': 0, 'C': 0, 'G': 0, 'M': 0, 'B': 0, 'Y': 0, 'O': 0, 'R': 0, 'A': 0}
	for i in AAA:
		if i <= 399:
			jisyo['H'] += 1
		elif 400 <= i <= 799:
			jisyo['C'] += 1
		elif 800 <= i <= 1199:
			jisyo['G'] += 1
		elif 1200 <= i <= 1599:
			jisyo['M'] += 1
		elif 1600 <= i <= 1999:
			jisyo['B'] += 1
		elif 2000 <= i <= 2399:
			jisyo['Y'] += 1
		elif 2400 <= i <= 2799:
			jisyo['O'] += 1
		elif 2800 <= i <= 3199:
			jisyo['R'] += 1
		else:
			jisyo['A'] += 1
	maxi = 0
	mini = 0
	for (i, j) in jisyo.items():
		if i != 'A':
			if j > 0:
				mini += 1
		else:
			maxi += j
	ans = maxi + mini
	if mini == 0:
		mini = 1
	return print(mini, ans)
N = int(input())
AA = list(map(int, input().split()))
cordtest(AA)


n = int(input())
a = list(map(int, input().split()))
c = [0] * 8
sums = 0
sai = 0
for i in a:
	if i < 3200:
		c[i // 400] = 1
	else:
		sai += 1
sums = sum(c)
print(max(1, sums), sums + sai)


n = int(input())
ci = [0] * 8
ov = 0
a = list(map(int, input().split()))
for pt in a:
	if pt >= 3200:
		ov += 1
	else:
		ci[pt // 400] = 1
ans = sum(ci)
print(max(1, ans), ans + ov)


from collections import Counter
n = int(input())
a = list(map(int, input().split()))
r = Counter([min(x // 400, 8) for x in a])
l = len(list(iter(r)))
if r[8] == 0:
	print(l, l)
else:
	print(max(l - 1, 1), l - 1 + r[8])


n = int(input())
li = list(map(int, input().split()))
se = set()
high = 0
for a in li:
	if a // 400 <= 7:
		se.add(a // 400)
	else:
		high += 1
print(max(1, len(se)), len(se) + high)


(N, *a) = map(int, open(0).read().split())
ans = set()
over = 0
for v in a:
	v //= 400
	if v < 8:
		ans.add(v)
	else:
		over += 1
print(max(len(ans), 1), len(ans) + over)


c = [0] * 8
n = int(input())
a = list(map(int, input().split()))
r = 0
for i in a:
	if i > 3199:
		r += 1
	else:
		c[i // 400] = 1
b = c.count(1)
print(max(b, 1), b + r)


(n, *a) = map(int, open(0).read().split())
b = [s // 400 for s in a if s < 3200]
c = len(set(b))
print(c or 1, n - len(b) + c)


n = int(input())
A = list(map(int, input().split()))
A = [a for a in A if a < 3200]
free = n - len(A)
A = set(map(lambda x: x // 400, A))
print(max(1, len(A)), len(A) + free)


(N, *A) = map(int, open(0).read().split())
l = [0] * 9
for a in A:
	l[min(8, a // 400)] += 1
m = sum([0 < l[i] for i in range(8)])
print(max(m, 1), m + l[8])


N = int(input())
A = list(map(int, input().split()))
L = [0] * 8
RED = 0
for i in range(N):
	if A[i] // 400 >= 8:
		RED += 1
	else:
		L[A[i] // 400] = 1
print(max(sum(L), 1), sum(L) + RED)


N = int(input())
a = list(map(int, input().split()))
dic = {}
free = 0
for i in a:
	if i // 400 < 8:
		dic[i // 400] = 1
	else:
		free += 1
print(max(1, len(dic)), len(dic) + free)


n = int(input())
a = list(map(lambda x: int(x) // 400, input().split()))
r = len(set(range(8)) & set(a))
cnt = 0
for i in a:
	if i >= 8:
		cnt += 1
(x, y) = (max(r, 1), r + cnt)
print(x, y)


from collections import defaultdict
n = input()
A = [int(i) for i in input().split()]
c = defaultdict(int)
free = 0
for a in A:
	if a > 3199:
		free += 1
	else:
		c[a // 400] += 1
print(max(len(c), 1), len(c) + free)


(n, *a) = map(int, open(0).read().split())
rank = [0] * 9
for aa in a:
	rank[aa // 400 if aa < 3200 else 8] += 1
cnt = 8
for i in range(8):
	if rank[i] == 0:
		cnt -= 1
print('{} {}'.format(max(1, cnt), cnt + rank[8]))


(n, *A) = map(int, open(0).read().split())
c = [0] * 9
for a in A:
	c[min(8, a // 400)] += 1
cl = 8 - c[:-1].count(0)
cmin = max(1, cl)
cmax = cl + c[8]
print(cmin, cmax)


(n, *aa) = map(int, open(0).read().split())
ranks = [a // 400 for a in aa]
optional = [a for a in ranks if a > 7]
ordinal = {a for a in ranks if a <= 7}
print(max(1, len(ordinal)), len(ordinal) + len(optional))


N = int(input())
R = [int(i) for i in input().split()]
S = set()
f = 0
for i in R:
	if i // 400 < 8:
		S.add(i // 400)
	else:
		f += 1
t = max(1, len(S))
mx = len(S) + f
print(t, mx)


N = int(input())
A = [int(x) for x in input().split()]
d = [False] * 8
count = 0
ans = 0
for a in A:
	if a // 400 >= 8:
		count += 1
	elif d[a // 400] == False:
		ans += 1
		d[a // 400] = True
if count == 0:
	print(ans, ans)
elif ans == 0:
	print(1, count)
else:
	print(ans, ans + count)


N = int(input())
A = list(map(int, input().split()))
cnt = 0
X = set()
for i in range(N):
	if A[i] >= 3200:
		cnt += 1
	else:
		X.add(A[i] // 400)
if len(X):
	print(len(X), len(X) + cnt)
else:
	print(1, cnt)


N = int(input())
a = list(map(int, input().split()))
c = [0] * 9
for i in range(N):
	c[min(a[i] // 400, 8)] += 1
temp = [1 for i in range(8) if c[i] > 0]
x = len(temp)
y = x + c[8]
print(max(x, 1), y)


def index(rate):
	if rate <= 3199:
		idx = rate // 400
	else:
		idx = 'free'
	return idx

def main():
	n = int(input())
	a_lst = list(map(int, input().split()))
	color_lst = [0] * 8
	free = 0
	for i in range(n):
		rate = a_lst[i]
		idx = index(rate)
		if idx == 'free':
			free += 1
		else:
			color_lst[idx] = 1
	types = 0
	for i in range(8):
		if color_lst[i] == 1:
			types += 1
	if types > 0:
		minimum = types
	else:
		minimum = 1
	maximum = types
	max_add = free
	maximum += max_add
	print(minimum, maximum)

def __starting_point():
	main()
__starting_point()


n = int(input())
a = list(map(int, input().split()))
o = 0
x = []
for i in range(n):
	if a[i] >= 3200:
		o += 1
	else:
		x.append(a[i] // 400)
p = len(set(x))
q = max(1, p)
print(q, o + p)


a = [0] * 9
input()
for x in input().split():
	x = int(x)
	if x < 3200:
		a[x // 400] = 1
	else:
		a[8] += 1
b = sum(a[:8])
print(max(b, 1), b + a[8])


N = int(input())
a = list(map(int, input().split()))
x = [i // 400 for i in a]
mina = len(set([i for i in x if i < 8]))
maxa = mina + len([i for i in x if i >= 8])
print(max(mina, 1), maxa)


al = [0] * 13
input()
for i in input().split():
	al[int(i) // 400] += 1
tuyoi = sum(al[8:])
iru = sum([1 for a in al[:8] if a > 0])
print(max(1, iru), iru + tuyoi)


N = int(input())
A = list(map(int, input().split()))
(S, red) = (set([]), 0)
for i in range(N):
	rank = A[i] // 400
	if rank < 8:
		S.add(rank)
	else:
		red += 1
print(max(1, len(S)), len(S) + red)


n = int(input())
rate = list(map(int, input().split()))
v = [0] * 9
for i in range(n):
	c = int(rate[i] / 400)
	if c >= 8:
		v[8] += 1
	else:
		v[c] = 1
s = sum(v[:8])
mi = max(1, s)
ma = s + v[8]
print(mi, ma)


N = int(input())
rate = [0] * 9
for a in [int(x) for x in input().split()]:
	rate[min(a, 3200) // 400] += 1
ret = 0
for r in rate[:-1]:
	if r:
		ret += 1
print(max(ret, 1), ret + rate[-1])


n = int(input())
a = list(map(int, input().split()))
x = [0] * 9
for i in a:
	x[min(i // 400, 8)] += 1
if x[8] == 0:
	print(9 - x.count(0), 9 - x.count(0))
else:
	print(max(1, 8 - x.count(0)), 8 - x.count(0) + x[8])


n = int(input())
a = list(map(int, input().split()))
ans = [False] * 8
tmp = 0
for i in a:
	if i > 3199:
		tmp += 1
	else:
		ans[i // 400] = True
print(max(sum(ans), 1), sum(ans) + tmp)


n = int(input())
a = list(map(int, input().split()))
s = set()
c = 0
for i in a:
	if i // 400 >= 8:
		c += 1
	else:
		s.add(i // 400)
if len(s) == 0:
	print(1, c)
else:
	print(len(s), len(s) + c)


n = int(input())
list = list(map(int, input().split()))
ans = set()
temp = 0
for i in list:
	if i >= 3200:
		temp += 1
	else:
		ans.add(i // 400)
print(max(1, len(ans)), len(ans) + temp)


N = int(input())
List = list(map(int, input().split()))
sumList = [0] * 8
mid = 0
for i in range(N):
	if 1 <= List[i] <= 399:
		sumList[0] += 1
	elif 400 <= List[i] <= 799:
		sumList[1] += 1
	elif 800 <= List[i] <= 1199:
		sumList[2] += 1
	elif 1200 <= List[i] <= 1599:
		sumList[3] += 1
	elif 1600 <= List[i] <= 1999:
		sumList[4] += 1
	elif 2000 <= List[i] <= 2399:
		sumList[5] += 1
	elif 2400 <= List[i] <= 2799:
		sumList[6] += 1
	elif 2800 <= List[i] <= 3199:
		sumList[7] += 1
	elif 3200 <= List[i]:
		mid += 1
res1 = 8 - sumList.count(0)
res2 = res1 + mid
if res1 == 0 and mid > 0:
	res1 = 1
print(res1, res2)


n = int(input())
player = list(map(int, input().split()))
result = [0] * 8
free_color = 0
for i in range(n):
	color = player[i] // 400
	if color < 8:
		result[color] = 1
	else:
		free_color += 1
num = 8 - result.count(0)
print('{} {}'.format(max(num, 1), num + free_color))


n = int(input())
a = list(map(int, input().split()))
l = [False] * 9
for i in a:
	if i < 3200:
		l[i // 400] = True
	else:
		l[8] += 1
if sum(l[:8]) > 0:
	print(sum(l[:8]), sum(l))
else:
	print(1, sum(l))


N = int(input())
a = list(map(int, input().split()))
for i in range(N):
	a[i] //= 400
ans = 0
for i in range(8):
	if i in a:
		ans += 1
y = 0
for x in a:
	if x >= 8:
		y += 1
print(max(ans, 1), ans + y)


(n, *a) = map(int, open(0).read().split())
(c, *l) = [0] * 9
for i in a:
	if i < 3200:
		l[i // 400] = 1
	else:
		c += 1
print(max(1, sum(l)), sum(l) + c)


N = int(input())
A = [0 for _ in range(9)]
for a in map(int, input().split()):
	A[min(a // 400, 8)] += 1
rate_num = 8 - A[:-1].count(0)
print(max(1, rate_num), rate_num + A[-1])


n = int(input())
a = list(map(int, input().split()))
c = [0, 0, 0, 0, 0, 0, 0, 0]
f = 0
for i in a:
	if i // 400 < 8:
		c[i // 400] = 1
	else:
		f += 1
ans = 0
for i in c:
	ans += i
print(max(1, ans), ans + f)


a = int(input())
b = list(map(int, input().split()))
c = 0
d = 0
e = 0
f = 0
g = 0
h = 0
i = 0
j = 0
k = 0
x = 0
for z in range(a):
	if b[z] <= 399:
		c = c + 1
	if 400 <= b[z] < 799:
		d = d + 1
	if 800 <= b[z] <= 1199:
		e = e + 1
	if 1200 <= b[z] <= 1599:
		f = f + 1
	if 1600 <= b[z] <= 1999:
		g = g + 1
	if 2000 <= b[z] <= 2399:
		h = h + 1
	if 2400 <= b[z] <= 2799:
		i = i + 1
	if 2800 <= b[z] <= 3199:
		j = j + 1
	if b[z] >= 3200:
		k = k + 1
if c != 0:
	x = x + 1
if d != 0:
	x = x + 1
if e != 0:
	x = x + 1
if f != 0:
	x = x + 1
if g != 0:
	x = x + 1
if h != 0:
	x = x + 1
if i != 0:
	x = x + 1
if j != 0:
	x = x + 1
if k + x > a:
	print(x, a)
elif c + d + e + f + g + h + i + j == 0 and k != 0:
	print(1, k)
else:
	print(x, k + x)


(N, *A) = map(int, open(0).read().split())
colors = [0 for i in range(8)]
tyty = 0
for a in A:
	c = a // 400
	if c >= 8:
		tyty += 1
	else:
		colors[c] += 1
cNum = 8 - colors.count(0)
minC = max(cNum, 1)
maxC = cNum + tyty
print(minC, maxC)


n = int(input())
A = list(map(int, input().split()))
ans = [0] * 8
r = 0
for i in range(n):
	if A[i] < 3200:
		ans[A[i] // 400] = 1
	else:
		r += 1
print(*[max(sum(ans), 1), sum(ans) + r])


n = int(input())
a = list(map(int, input().split()))
b = dict()
for i in a:
	b[i // 400] = b.get(i // 400, 0) + 1
count = 0
count2 = 0
for i in b:
	if i > 7:
		count2 += b[i]
	else:
		count += 1
print(max(count, 1), count + count2)


N = int(input())
A = list(map(int, input().split()))
color = set()
free = 0
for a in A:
	if a < 3200:
		color |= {a // 400}
	else:
		free += 1
print(str(max(1, len(color))) + ' ' + str(len(color) + free))


n = int(input())
a_list = [int(x) for x in input().split()]
s = set()
o = 0
for a in a_list:
	r = a // 400
	if r >= 8:
		o += 1
	else:
		s.add(r)
c = len(s)
print(c if c > 0 else 1, c + o)


li = [0] * 9
n = int(input())
a = list(map(int, input().split()))
for i in a:
	if i // 400 > 7:
		li[8] += 1
	else:
		li[i // 400] = 1
print(max(1, sum(li[:-1])), sum(li))


N = int(input())
A = list(map(int, input().split()))
red = 0
rate = []
for a in A:
	if a >= 3200:
		red += 1
	else:
		rate.append(a // 400)
cnt = len(set(rate))
print(max(1, cnt), cnt + red)


n = int(input())
al = list(map(int, input().split()))
ratel = [0, 0, 0, 0, 0, 0, 0, 0, 0]

def check(a):
	if 1 <= a <= 399:
		return 0
	elif 400 <= a <= 799:
		return 1
	elif 800 <= a <= 1199:
		return 2
	elif 1200 <= a <= 1599:
		return 3
	elif 1600 <= a <= 1999:
		return 4
	elif 2000 <= a <= 2399:
		return 5
	elif 2400 <= a <= 2799:
		return 6
	elif 2800 <= a <= 3199:
		return 7
	else:
		return 8
for a in al:
	i = check(a)
	ratel[i] += 1
zeroc = 0
ratec = 0
for i in range(8):
	if ratel[i] == 0:
		zeroc += 1
	else:
		ratec += 1
if ratel[8] == 0:
	print(ratec, ratec)
elif 1 <= ratel[8] <= 8:
	if ratec == 0:
		print(1, ratel[8])
	elif ratel[8] < zeroc:
		print(ratec, ratec + ratel[8])
	elif ratel[8] >= zeroc:
		print(ratec, ratec + ratel[8])
elif ratec == 0:
	print(1, ratel[8])
else:
	print(ratec, ratec + ratel[8])


n = int(input())
a = map(int, input().split())
l = [0 for i in range(9)]
for i in a:
	if i // 400 >= 8:
		l[8] += 1
	else:
		l[i // 400] = 1
print(max(1, sum(l[:8])), sum(l))


N = int(input())
N_List = list(map(int, input().split()))
NR_List = [i // 400 for i in N_List]
Number_NRD = len(set([i for i in NR_List if i < 8]))
Number_NRU = len([i for i in NR_List if i >= 8])
max_p = Number_NRD + Number_NRU
min_p = (Number_NRD, 1)[Number_NRD == 0]
print(str(min_p) + ' ' + str(max_p))


N = int(input())
a = list(map(int, input().split()))
color = [0] * 9
for i in range(N):
	if 1 <= a[i] <= 399:
		color[0] += 1
	elif 400 <= a[i] <= 799:
		color[1] += 1
	elif 800 <= a[i] <= 1199:
		color[2] += 1
	elif 1200 <= a[i] <= 1599:
		color[3] += 1
	elif 1600 <= a[i] <= 1999:
		color[4] += 1
	elif 2000 <= a[i] <= 2399:
		color[5] += 1
	elif 2400 <= a[i] <= 2799:
		color[6] += 1
	elif 2800 <= a[i] <= 3199:
		color[7] += 1
	elif 3200 <= a[i]:
		color[8] += 1
count = 0
for i in range(8):
	if color[i] != 0:
		count += 1
if count == 0:
	print(1, count + color[8])
else:
	print(count, count + color[8])


n = int(input())
arr = list(map(int, input().split()))
r = 0
cols = [0] * 8
for i in arr:
	color = i // 400
	if color <= 7:
		cols[color] = 1
	else:
		r += 1
c = sum(cols)
print(max(1, c), r + c)


n = int(input())
a = list(map(int, input().split()))
color = []
(count, free) = (0, 0)
for i in range(n):
	c = a[i] // 400
	if a[i] < 3200 and c not in color:
		color.append(c)
		count += 1
	elif a[i] >= 3200:
		free += 1
(min, max) = (0, 0)
if count == 0:
	max = free
	min = 1
else:
	max = count + free
	min = count
print(min, max)


n = int(input())
arr = list(map(int, input().split()))
colors = [0] * 8
over = 0
for i in arr:
	if i >= 3200:
		over += 1
	else:
		colors[i // 400] += 1
res = 8 - colors.count(0)
if res:
	print(res, res + over)
else:
	print(1, over)


n = int(input())
b = [s // 400 for s in map(int, input().split()) if s < 3200]
c = len(set(b))
print(max(c, 1), n - len(b) + c)


N = int(input())
A = list(map(int, input().split()))
B = [x // 400 for x in A]
(a, b) = (0, 0)
for i in range(13):
	if i < 8:
		if i in B:
			a += 1
	else:
		b += B.count(i)
print(max(a, 1), a + b)


n = int(input())
l = list(map(int, input().split()))
ans = [0 for i in range(8)]
rate_3200 = 0
for i in l:
	if 1 <= i <= 399:
		ans[0] += 1
	elif 400 <= i <= 799:
		ans[1] += 1
	elif 800 <= i <= 1199:
		ans[2] += 1
	elif 1200 <= i <= 1599:
		ans[3] += 1
	elif 1600 <= i <= 1999:
		ans[4] += 1
	elif 2000 <= i <= 2399:
		ans[5] += 1
	elif 2400 <= i <= 2799:
		ans[6] += 1
	elif 2800 <= i <= 3199:
		ans[7] += 1
	elif 3200 <= i:
		rate_3200 += 1
if rate_3200 == 0:
	num = 8 - ans.count(0)
	print('{} {}'.format(num, num))
else:
	count_0 = ans.count(0)
	if count_0 == 8:
		min_num = 1
		max_num = rate_3200
	else:
		min_num = 8 - count_0
		max_num = 8 - count_0 + rate_3200
	print('{} {}'.format(min_num, max_num))


n = int(input())
a = list(map(int, input().split()))
l = [x // 400 for x in a if x < 3200]
free = len([x for x in a if x >= 3200])
from collections import Counter
c = Counter(l)
print(max(len(c), 1), len(c) + free)


n = int(input())
a = sorted(map(int, input().split()))
c = [0] * 9
for num in a:
	if num < 400:
		c[0] += 1
	elif num < 800:
		c[1] += 1
	elif num < 1200:
		c[2] += 1
	elif num < 1600:
		c[3] += 1
	elif num < 2000:
		c[4] += 1
	elif num < 2400:
		c[5] += 1
	elif num < 2800:
		c[6] += 1
	elif num < 3200:
		c[7] += 1
	else:
		c[8] += 1
mi = 0
ma = 0
for i in range(8):
	if c[i] >= 1:
		mi += 1
		ma += 1
ma += c[8]
if mi == 0:
	if c[8] >= 1:
		mi += 1
print(str(mi) + ' ' + str(ma))


from collections import Counter
N = int(input())
a = Counter([min(int(ai) // 400, 8) for ai in input().split()])
tmp = sum((bool(a[i]) for i in range(8)))
print(max(1, tmp), tmp + a[8])


import sys
pin = sys.stdin.readline

def main():
	N = int(pin())
	a = list(map(int, pin().split()))
	d = [0] * 9
	for i in a:
		if i >= 3200:
			d[-1] += 1
			continue
		d[i // 400] += 1
	ans = 0
	for i in d[:-1]:
		if i != 0:
			ans += 1
	if ans == 0:
		print(f'{1} {d[-1]}')
		return
	print(f'{ans} {ans + d[-1]}')
	return
main()


N = int(input())
a = list(map(int, input().split()))
b = [a[i] // 400 for i in range(N) if a[i] < 3200]
c = len(set(b))
print(max(1, c), c + N - len(b))


n = int(input())
a = list(map(int, input().split()))
b = [0 for i in range(9)]
for i in range(n):
	b[min([a[i] // 400, 8])] += 1
ans1 = len([i for i in b[:8] if i > 0])
ans2 = ans1 + b[8]
ans1 = max([ans1, 1])
print(ans1, ans2)


N = int(input())
A = list(map(int, input().split()))
cnt = [0] * 8
c = 0
for a in A:
	if a <= 399:
		cnt[0] += 1
	elif a >= 400 and a <= 799:
		cnt[1] += 1
	elif a >= 800 and a <= 1199:
		cnt[2] += 1
	elif a >= 1200 and a <= 1599:
		cnt[3] += 1
	elif a >= 1600 and a <= 1999:
		cnt[4] += 1
	elif a >= 2000 and a <= 2399:
		cnt[5] += 1
	elif a >= 2400 and a <= 2799:
		cnt[6] += 1
	elif a >= 2800 and a <= 3199:
		cnt[7] += 1
	else:
		c += 1
Min = len([i for i in cnt if i != 0])
if c == 0:
	print(Min, Min)
else:
	Max = Min + c
	if Min == 0:
		print(1, Max)
	else:
		print(Min, Max)


N = int(input())
a = list(map(int, input().split()))
color = [0] * 8
freer = 0
for i in a:
	if i < 3200:
		color[i // 400] += 1
	else:
		freer += 1
ans_base = 8 - color.count(0)
if ans_base == 0:
	ans_min = 1
else:
	ans_min = ans_base
ans_max = ans_base + freer
print(ans_min, ans_max)


n = int(input())
a = list(map(int, input().split()))
s = [0] * 13
for i in a:
	s[i // 400] += 1
ans = 0
for i in range(8):
	if s[i] > 0:
		ans += 1
print(max(1, ans), ans + sum(s[8:]))


N = int(input())
A = list(map(int, input().split()))
S = set()
cnt = 0
for i in A:
	if i >= 3200:
		cnt += 1
	else:
		S.add(i // 400)
if len(S) == 0:
	low = 1
	high = cnt
else:
	low = len(S)
	high = cnt + low
print(low, high)


N = int(input())
a = list(map(int, input().split()))
ans = [0 for i in range(9)]
for i in range(N):
	temp = a[i] // 400
	if temp > 8:
		ans[8] += 1
	else:
		ans[temp] += 1
nin = 0
for i in range(8):
	if ans[i] != 0:
		nin += 1
if nin == 0 and ans[8] != 0:
	nin += 1
	nax = ans[8]
else:
	nax = nin + ans[8]
print(nin, nax)


n = int(input())
A = list(map(int, input().split()))
rate = [0 for _ in range(9)]
for a in A:
	if a < 400:
		rate[0] += 1
	elif a < 800:
		rate[1] += 1
	elif a < 1200:
		rate[2] += 1
	elif a < 1600:
		rate[3] += 1
	elif a < 2000:
		rate[4] += 1
	elif a < 2400:
		rate[5] += 1
	elif a < 2800:
		rate[6] += 1
	elif a < 3200:
		rate[7] += 1
	else:
		rate[8] += 1
ans = 0
for i in range(8):
	if rate[i] >= 1:
		ans += 1
if ans == 0:
	print(1, rate[8])
else:
	print(ans, ans + rate[8])


n = int(input())
a = list(map(int, input().split()))
(s, x) = (set(), 0)
for i in a:
	if i < 3200:
		s.add(i // 400)
	else:
		x += 1
print(max(len(s), 1), len(s) + x)


n = int(input())
a = list(map(int, input().split()))
l = [0] * 9
cnt = 0
for i in a:
	if i < 400:
		l[0] += 1
	elif i < 800:
		l[1] += 1
	elif i < 1200:
		l[2] += 1
	elif i < 1600:
		l[3] += 1
	elif i < 2000:
		l[4] += 1
	elif i < 2400:
		l[5] += 1
	elif i < 2800:
		l[6] += 1
	elif i < 3200:
		l[7] += 1
	else:
		l[8] += 1
for i in range(8):
	if l[i] >= 1:
		cnt += 1
if cnt == 0:
	print(1, l[8])
else:
	print(cnt, cnt + l[8])


N = int(input())
a = list(map(int, input().split()))
color = [0] * 9
for i in a:
	color[min(i, 3200) // 400] += 1
x = 8 - color[:-1].count(0)
ans = [max(1, x), x + color[8]]
print(' '.join(map(str, ans)))


n = int(input())
colors = [0] * 13
for i in list(map(int, input().split())):
	colors[i // 400] += 1
ans = 8 - colors[:8].count(0)
free = sum(colors[8:])
print(max(1, ans), max(1, ans + free))


input()
(*A,) = map(lambda x: int(x) // 400, input().split())
high = 0
c = set()
for a in A:
	if a >= 8:
		high += 1
	else:
		c.add(a)
n = len(c)
print(max(n, 1), n + high)


n = int(input())
a = list(map(int, input().split()))
ans = [0] * 9
for ai in a:
	if ai // 400 > 7:
		ans[8] += 1
	else:
		ans[ai // 400] = 1
print(max(1, sum(ans[:-1])), sum(ans))


(n, *a) = map(int, open(0).read().split())
x = [i // 400 for i in a if i < 3200]
y = len(set(x))
print(max(y, 1), n - len(x) + y)


from collections import Counter as C
n = int(input())
A = sorted(C(list(map(lambda x: min(x // 400, 8), list(map(int, input().split())))) + [8]).most_common())
print(len(A) - 1 if A[0][0] != 8 else 1, len(A) + A[-1][1] - 2)


from collections import defaultdict
N = int(input())
a = list(map(int, input().split()))
d = defaultdict(int)
for x in a:
	d[min(x // 400, 8)] += 1
mi = len(d.keys())
if d[8] > 0 and mi >= 2:
	mi -= 1
mx = d[8] + len([i for i in range(8) if i in d])
print(mi, mx)


N = int(input())
a = list(map(int, input().split()))
seen = [False] * 8
cnt = 0
cnt_3200 = 0
for i in a:
	i = i // 400
	if i >= 8:
		cnt_3200 += 1
	elif seen[i] == False:
		cnt += 1
		seen[i] = True
if cnt == 0:
	print(1, cnt_3200)
else:
	print(cnt, cnt + cnt_3200)


n = int(input())
a = [int(x) // 400 for x in input().split()]
b = 0
c = set()
for i in range(n):
	if a[i] > 7:
		b += 1
	else:
		c.add(a[i])
print(max(1, len(c)), len(c) + b)


n = int(input())
a = list(map(int, input().split()))
rate = [0, 399, 799, 1199, 1599, 1999, 2399, 2799, 3199, 4800]
cnt = [0] * 9
for i in a:
	for j in range(1, len(rate) + 1):
		if rate[j - 1] < i <= rate[j]:
			cnt[j - 1] += 1
fix = 0
flex = 0
for (i, result) in enumerate(cnt):
	if i == 8:
		flex = cnt[i]
	elif result > 0:
		fix += 1
if fix == 0 and flex >= 1:
	print(1, flex)
else:
	print(fix, fix + flex)


N = int(input())
rate = [1, 400, 800, 1200, 1600, 2000, 2400, 2800, 3200]
p = [0] * 9
A = [int(a) for a in input().split(' ')]
A.sort()
j = 0
for i in range(len(A)):
	while j < 8:
		if rate[j] <= A[i] < rate[j + 1]:
			p[j] = 1
			break
		else:
			j += 1
	else:
		p[8] = len(A[i:])
		break
print(str(max([sum(p[:8]), 1])) + ' ' + str(sum(p)))


n = int(input())
A = list(map(int, input().split()))
C = [0] * 9
for i in A:
	x = i // 400
	if x < 8:
		C[x] = 1
	else:
		C[8] += 1
b = sum(C[:8])
print(str(max(b, 1)) + ' ' + str(b + C[8]))


n = int(input())
alst = list(map(int, input().split()))
lst = [0 for _ in range(9)]
for num in alst:
	pos = min(num // 400, 8)
	lst[pos] += 1
cnt = 8 - lst[:-1].count(0)
print(max(cnt, 1), cnt + lst[-1])


import math
n = input()
a = [min(math.floor(int(i) // 400), 8) for i in input().split()]
a7 = len(set([i for i in a if i <= 7]))
a8 = len([i for i in a if i == 8])
print(max(a7, 1), a7 + a8)


n = input()
d = [0 for _ in range(9)]
seq = [int(x) for x in input().split()]
for val in seq:
	val = min(val, 3300)
	d[val // 400] += 1
a = sum((1 for val in d[:-1] if val > 0))
print(max(1, a), a + d[-1])


n = int(input())
A = list(map(int, input().split()))
A = list(map(lambda x: x // 400 if x // 400 <= 7 else 8, A))
target = A.count(8)
total = len(set(A))
min = total - 1 if 8 in A else total
print(min if min != 0 else 1, min + target)


(n, *A) = map(int, open(0).read().split())
B = [0] * 9
for a in A:
	if a < 3200:
		B[a // 400] = 1
	else:
		B[8] += 1
print(max(sum(B[:8]), 1), sum(B))


N = int(input())
A = list(map(int, input().split()))
C = [a // 400 for a in A if a < 3200]
M = len(set(C))
print(max(1, M), M + N - len(C))


N = int(input())
n = [int(i) // 400 for i in input().split()]
c = 0
for i in n:
	if i >= 8:
		c += 1
n_kind = [i for i in n if i < 8]
a = len(set(n_kind))
if a == 0:
	print(1, c)
else:
	print(a, a + c)


n = int(input())
a = list(map(int, input().split()))
l = [0 for i in range(9)]
for j in range(n):
	l[min(a[j], 3200) // 400] += 1
c = 0
for k in range(len(l) - 1):
	if l[k] > 0:
		c += 1
if c == 0:
	print(1, c + l[8])
else:
	print(c, c + l[8])


n = int(input())
a = list(map(int, input().split()))
b = [0] * 8
c = 0
for x in a:
	if x < 400:
		b[0] = 1
	elif x < 800:
		b[1] = 1
	elif x < 1200:
		b[2] = 1
	elif x < 1600:
		b[3] = 1
	elif x < 2000:
		b[4] = 1
	elif x < 2400:
		b[5] = 1
	elif x < 2800:
		b[6] = 1
	elif x < 3200:
		b[7] = 1
	else:
		c += 1
x = b.count(1)
print(max(x, 1), x + c)


(n, *l) = map(int, open(0).read().split())
c = [0] * 13
for i in l:
	c[i // 400] += 1
a = 8 - c[:8].count(0)
print(max(1, a), a + sum(c[8:]))


n = int(input())
a = list(map(int, input().split()))
cnt = [0] * 8
free = 0
for i in range(n):
	if a[i] <= 3199:
		cnt[a[i] // 400] += 1
	else:
		free += 1
print(max(1, 8 - cnt.count(0)), 8 - cnt.count(0) + free)


from sys import stdin, stdout

def get_level(n):
	return min(n // 400, 8)

def solve():
	n = int(input())
	a = list(map(int, input().split()))
	level_num = dict()
	for i in range(9):
		level_num[i] = 0
	for contestant in a:
		lvl = get_level(contestant)
		level_num[lvl] += 1
	min_num = 0
	for lvl in level_num:
		if level_num[lvl] > 0 and lvl < 8:
			min_num += 1
	max_num = min_num + level_num[8]
	if min_num < 1:
		min_num = 1
	print(min_num, max_num)

def main():
	solve()

def __starting_point():
	main()
__starting_point()


n = int(input())
a = list(map(int, input().split()))
b = [0] * 9
for i in a:
	b[min(i // 400, 8)] += 1
print(max(8 - b[:8].count(0), 1), 8 - b[:8].count(0) + b[8])


n = int(input())
a = list(map(int, input().split()))
d = [0] * 8
over = 0
for i in a:
	lv = i // 400
	if lv < 8:
		d[lv] = 1
	else:
		over += 1
print(max(sum(d), 1), sum(d) + over)


n = input()
A = list(map(int, input().split()))
flags = [False] * 8
count = 0
for a in A:
	if a < 3200:
		flags[a // 400] = True
	else:
		count += 1
print(max(sum(flags), 1), sum(flags) + count)


N = int(input())
a = list(map(int, input().split()))
color = []
rainbow = 0
for i in range(N):
	if 1 <= a[i] <= 399:
		color.append('gray')
	elif 400 <= a[i] <= 799:
		color.append('brown')
	elif 800 <= a[i] <= 1199:
		color.append('green')
	elif 1200 <= a[i] <= 1599:
		color.append('sky')
	elif 1600 <= a[i] <= 1999:
		color.append('blue')
	elif 2000 <= a[i] <= 2399:
		color.append('yellow')
	elif 2400 <= a[i] <= 2799:
		color.append('orange')
	elif 2800 <= a[i] <= 3199:
		color.append('red')
	else:
		rainbow += 1
		color.append('all')
if len(set(color)) == 1 and rainbow > 0:
	mini = 1
elif rainbow == 0:
	mini = len(set(color))
else:
	mini = max(1, len(set(color)) - 1)
if rainbow > 1:
	maxi = len(set(color)) + rainbow - 1
else:
	maxi = len(set(color))
print(mini, maxi)


N = int(input())
A = list(map(int, input().split()))
color = [0] * 9
for a in A:
	if a <= 399:
		color[0] = 1
	elif a <= 799:
		color[1] = 1
	elif a <= 1199:
		color[2] = 1
	elif a <= 1599:
		color[3] = 1
	elif a <= 1999:
		color[4] = 1
	elif a <= 2399:
		color[5] = 1
	elif a <= 2799:
		color[6] = 1
	elif a <= 3199:
		color[7] = 1
	else:
		color[8] += 1
max_num = sum(color)
min_num = max(1, sum(color[:-1]))
print(min_num, max_num)


from collections import Counter as C
N = int(input())
A = C([min(int(a) // 400, 8) for a in input().split()])
a = sum([A[i] > 0 for i in range(8)])
print(max(a, 1), a + A[8])


N = int(input())
A = list(map(int, input().split()))
X = [0] * 8
Y = 0
for a in A:
	if a >= 3200:
		Y += 1
	else:
		X[a // 400] += 1
a = max(1, 8 - X.count(0))
b = 8 - X.count(0) + Y
print(a, b)


n = int(input())
s = list(map(int, input().split()))
l = [0 for _ in range(13)]
for x in s:
	l[x // 400] += 1
j = sum((r > 0 for r in l[:8]))
print(max(1, j), j + sum(l[8:]))


N = int(input())
lsa = list(map(int, input().split()))
lsb = []
joker = 0
for i in lsa:
	if i >= 1 and i <= 399:
		lsb.append('1')
	elif i >= 400 and i <= 799:
		lsb.append('2')
	elif i >= 800 and i <= 1199:
		lsb.append('3')
	elif i >= 1200 and i <= 1599:
		lsb.append('4')
	elif i >= 1600 and i <= 1999:
		lsb.append('5')
	elif i >= 2000 and i <= 2399:
		lsb.append('6')
	elif i >= 2400 and i <= 2799:
		lsb.append('7')
	elif i >= 2800 and i <= 3199:
		lsb.append('8')
	elif i >= 3200:
		joker += 1
s1 = len(set(lsb))
s2 = s1 + joker
print(max(s1, 1), s2)


n = int(input())
A = list(map(int, input().split()))
c = [0] * 8
maxc = 0
for a in A:
	if a >= 3200:
		maxc += 1
	else:
		c[a // 400] = 1
minc = c.count(1)
ans = minc + maxc
print(max(minc, 1), ans)


def main():
	n = int(input())
	a = list(map(int, input().split()))
	l = [i // 400 for i in a if i < 3200]
	c = len(set(l))
	print(max(1, c), c + n - len(l))
main()


n = int(input())
a = [0] * 8
b = 0
for x in input().split():
	x = int(x)
	if x >= 3200:
		b += 1
	else:
		a[x // 400] += 1
m = 0
for x in a:
	if x > 0:
		m += 1
print(max(m, 1), m + b)


N = int(input())
(*A,) = map(int, input().split())
count = [min(i // 400, 8) for i in A]
c8 = count.count(8)
if c8 > 0:
	print(max(len(set(count)) - 1, 1), len(set(count)) + c8 - 1)
else:
	print(len(set(count)), len(set(count)))


n = int(input())
a = list(map(int, input().split()))
upper = [399, 799, 1199, 1599, 1999, 2399, 2799, 3199, 4800]
lower = [1, 400, 800, 1200, 1600, 2000, 2400, 2800, 3200]
cnt = 0
tops = 0
for color in range(9)[::-1]:
	for i in range(n):
		if color == 8:
			if lower[color] <= a[i] <= upper[color]:
				tops += 1
		elif lower[color] <= a[i] <= upper[color]:
			cnt += 1
			break
print(max(1, cnt), cnt + tops)


N = int(input())
a = list(map(int, input().split()))
R = [0] * 9
for r in a:
	rr = r // 400
	if rr < 8:
		R[rr] = 1
	else:
		R[8] += 1
s2 = sum(R)
s1 = max(1, s2 - R[8])
print(s1, s2)


(n, *a) = map(int, open(0).read().split())
(*a,) = filter(lambda x: x < 3200, a)
b = len(set([x // 400 for x in a]))
print(b or 1, n - len(a) + b)


N = int(input())
A = [int(x) for x in input().split()]
s = set()
god = 0
for a in A:
	if a >= 3200:
		god += 1
	else:
		s.add(a // 400)
print('{} {}'.format(max(len(s), 1), len(s) + god))


n = int(input())
a = list(map(int, input().split()))
for i in range(n):
	a[i] //= 400
free = 0
b = set()
for i in range(n):
	if a[i] >= 8:
		free += 1
	else:
		b.add(a[i])
cnt = len(b)
x = max(cnt, 1)
y = cnt + free
print(x, y)


(n, a) = open(0)
s = set()
x = 0
for i in map(int, a.split()):
	j = i // 400
	if j < 8:
		s.add(j)
	else:
		x += 1
print(max(1, len(s)), len(s) + x)


from collections import Counter
input()
c = Counter([min(int(i) // 400, 8) for i in input().split()])
ans = 0
for i in range(8):
	ans += bool(c[i])
print(max(ans, 1), ans + c[8])


N = int(input())
A = list(map(int, input().split()))
B = [x // 400 for x in A if x // 400 <= 7]
num_l = len(B)
var_l = len(set(B))
print(max(1, var_l), var_l + N - num_l)


n = int(input())
a = list(map(int, input().split()))
rate = [0] * 8
s = 0
for i in a:
	if i < 400:
		rate[0] = 1
	elif 400 <= i < 800:
		rate[1] = 1
	elif 800 <= i < 1200:
		rate[2] = 1
	elif 1200 <= i < 1600:
		rate[3] = 1
	elif 1600 <= i < 2000:
		rate[4] = 1
	elif 2000 <= i < 2400:
		rate[5] = 1
	elif 2400 <= i < 2800:
		rate[6] = 1
	elif 2800 <= i < 3200:
		rate[7] = 1
	elif 3200 <= i:
		s += 1
ans1 = 8 - rate.count(0)
ans2 = ans1 + s
if ans1 == 0 and s != 0:
	ans1 = 1
print(ans1, ans2)


N = int(input())
A = list(map(int, input().split()))
R = [0] * 9
for a in A:
	if a < 400:
		R[0] += 1
	elif a < 800:
		R[1] += 1
	elif a < 1200:
		R[2] += 1
	elif a < 1600:
		R[3] += 1
	elif a < 2000:
		R[4] += 1
	elif a < 2400:
		R[5] += 1
	elif a < 2800:
		R[6] += 1
	elif a < 3200:
		R[7] += 1
	else:
		R[8] += 1
if sum(R[:-1]) != 0:
	M = 8 - R[:-1].count(0) + R[-1]
	m = 8 - R[:-1].count(0)
	print(m, M)
else:
	print(1, R[-1])


N = int(input())
A = list(map(int, input().split()))
C = [0] * 9
for a in A:
	C[min(8, a // 400)] += 1
s = sum([c > 0 for c in C[:-1]])
print(max(s, 1), s + C[-1])


n = int(input())
a = list(map(int, input().split()))
ans = 0
t = 400
while t < 3201:
	for i in a:
		if i >= t - 400 and i < t:
			ans += 1
			break
	t += 400
s = 0
for i in a:
	if i >= 3200:
		s += 1
if ans == 0:
	print(1, s)
else:
	print(ans, ans + s)


n = int(input())
A = list(map(int, input().split()))
s = set()
cnt = 0
for a in A:
	c = a // 400
	if c >= 8:
		cnt += 1
	else:
		s.add(c)
m = len(s)
if m:
	M = m + cnt
else:
	m = 1
	M = cnt
print(m, M)


N = int(input())
a = [i // 400 for i in map(int, input().split())]
min_a = sum((i < 8 for i in set(a)))
max_a = min_a + sum((i >= 8 for i in a))
print(max(min_a, 1), max_a)


n = int(input())
l = [0] * 9
for i in map(int, input().split()):
	l[min(8, i // 400)] += 1
mn = len(list(filter(lambda x: x > 0, l[:8])))
print(max(1, mn), mn + l[8])


n = int(input())
A = [int(i) for i in input().split()]
B = set()
crown = 0
for a in A:
	if a // 400 >= 8:
		crown += 1
	else:
		B.add(a // 400)
print(max(1, len(B)), len(B) + crown)


N = int(input())
a = list(map(int, input().split()))
mi = 0
ma = 0
l = []
count = 0
for i in range(N):
	if a[i] < 3200:
		l.append(a[i] // 400)
	else:
		count = count + 1
print(max(1, len(set(l))), max(1, len(set(l)) + count))


n = int(input())
a = list(map(int, input().split()))
a1 = 0
b = 0
c = 0
d = 0
e = 0
f = 0
g = 0
h = 0
ans = 0
for i in range(n):
	if 1 <= a[i] <= 399:
		a1 = 1
	elif 400 <= a[i] <= 799:
		b = 1
	elif 800 <= a[i] <= 1199:
		c = 1
	elif 1200 <= a[i] <= 1599:
		d = 1
	elif 1600 <= a[i] <= 1999:
		e = 1
	elif 2000 <= a[i] <= 2399:
		f = 1
	elif 2400 <= a[i] <= 2799:
		g = 1
	elif 2800 <= a[i] <= 3199:
		h = 1
	else:
		ans += 1
x = a1 + b + c + d + e + f + g + h
if a1 == b == c == d == e == f == g == h == 0:
	print(1, ans)
else:
	print(x, x + ans)


n = int(input())
a = list(map(int, input().split()))
ch = 0
b = [0 for _ in range(8)]
for r in a:
	t = r // 400
	if t >= 8:
		ch += 1
	else:
		b[t] += 1
c = 8 - b.count(0)
print(str(max(1, c)) + ' ' + str(c + ch))


n = int(input())
a = list(map(int, input().split()))
r = set()
r2 = 0
for i in a:
	if i >= 3200:
		r2 += 1
	else:
		r.add(i // 400)
if len(r) == 0:
	mi = 1
else:
	mi = len(r)
ma = len(r) + r2
print(mi, ma)


N = int(input())
a = list(map(int, input().split()))
c = [0] * 8
r = 0
for i in a:
	col = i // 400
	if col <= 7:
		c[col] = 1
	else:
		r += 1
c = sum(c)
print(max(1, c), r + c)


n = int(input())
l = list(map(int, input().split()))
s = set()
pro = 0
for x in l:
	div = x // 400
	if div < 8:
		s.add(div)
	else:
		pro += 1
print(len(s) if pro != n else 1, len(s) + pro)


n = int(input())
a = list(map(int, input().split()))
b = []
c = 0
for i in range(n):
	if a[i] < 3200:
		b.append(a[i] // 400)
	else:
		c += 1
l = len(set(b))
print(max(1, l), l + c)


n = int(input())
a = list(map(int, input().split()))
b = []
c = [0] * 8
d = 0
for i in a:
	if i < 3200:
		b.append(i)
	else:
		d += 1
for i in range(len(b)):
	for j in range(8):
		if 400 * j <= b[i] < 400 * (j + 1):
			c[j] = 1
print(max(sum(c), 1), sum(c) + d)


_ = input()
a = [int(x) for x in input().split()]
p = set()
q = 0
for i in a:
	if i < 3200:
		p.add(i // 400)
	else:
		q += 1
else:
	lenp = len(p)
	print(max(lenp, 1), lenp + q)


N = int(input())
a = list(map(int, input().split()))
b = [ai // 400 for ai in a]
ans = 0
for i in range(8):
	if i in b:
		ans += 1
m = sum([b.count(i) for i in range(8, 13)])
print(ans if ans else 1, ans + m)


l = [0] * 13
input()
for i in input().split():
	l[int(i) // 400] += 1
r = sum([1 for a in l[:8] if a > 0])
print(max(1, r), r + sum(l[8:]))


N = int(input())
a = [int(x) for x in input().split()]
b = [0] * 9
ans = 0
count = 0
for i in a:
	if i // 400 < 8:
		b[i // 400] = 1
	else:
		b[8] += 1
print(max(1, sum(b[:8])), sum(b))


N = int(input())
A = list(map(int, input().split()))
rate = {'a': 0, 'b': 0, 'c': 0, 'd': 0, 'e': 0, 'f': 0, 'g': 0, 'h': 0}
ratez = {'z': 0}
for i in range(N):
	if A[i] >= 1 and A[i] <= 399:
		rate['a'] += 1
	if A[i] >= 400 and A[i] <= 799:
		rate['b'] += 1
	if A[i] >= 800 and A[i] <= 1199:
		rate['c'] += 1
	if A[i] >= 1200 and A[i] <= 1599:
		rate['d'] += 1
	if A[i] >= 1600 and A[i] <= 1999:
		rate['e'] += 1
	if A[i] >= 2000 and A[i] <= 2399:
		rate['f'] += 1
	if A[i] >= 2400 and A[i] <= 2799:
		rate['g'] += 1
	if A[i] >= 2800 and A[i] <= 3199:
		rate['h'] += 1
	if A[i] >= 3200:
		ratez['z'] += 1
keys = [k for (k, v) in rate.items() if v != 0]
if ratez['z'] == 0:
	print(len(keys), len(keys))
elif len(keys) == 0:
	print(1, ratez['z'])
else:
	print(len(keys), len(keys) + ratez['z'])


n = int(input())
a = list(map(int, input().split()))
cnt = [0] * 9
for i in a:
	k = i // 400
	if k >= 8:
		cnt[8] += 1
	else:
		cnt[k] += 1
z = 0
for i in range(8):
	if cnt[i] >= 1:
		z += 1
print(1 if z == 0 else z, z + cnt[8])


N = int(input())
rate = list(map(int, input().split()))
cnt = 0
ans = []
for i in range(N):
	if rate[i] >= 3200:
		cnt += 1
	else:
		ans.append(rate[i] // 400)
s_ans = set(ans)
print(max(len(s_ans), 1), len(s_ans) + cnt)


n = int(input())
a = list(map(int, input().split()))
rate = [0] * 9
over = 0
for i in a:
	for j in range(1, 9):
		if 400 * (j - 1) <= i < 400 * j:
			rate[j] = 1
			break
		elif i >= 3200:
			over += 1
			break
ansmin = rate.count(1)
ansmax = rate.count(1)
if ansmin == 0:
	ansmin = 1
if over > 0:
	ansmax += over
print(ansmin, ansmax)


N = int(input())
A = list(map(int, input().split()))
B = [i // 400 for i in A if i < 3200]
if B == []:
	print(1, N)
elif len(B) == N:
	C = len(set(B))
	print(C, C)
else:
	C = len(set(B))
	D = C + N - len(B)
	print(C, D)


N = int(input())
A = list(map(int, input().split(' ')))
colors = [8 if a >= 3200 else a // 400 for a in A]
c1 = [1 if i in colors else 0 for i in range(8)]
c2 = colors.count(8)
print(max(1, c1.count(1)), c1.count(1) + c2)


n = int(input())
A = list(map(int, input().split()))
x = []
f = 0
for a in A:
	if a // 400 < 8:
		x.append(a // 400)
	else:
		f += 1
x = set(x)
l = len(x)
print(max(l, 1), l + f)


n = int(input())
a = [int(x) for x in input().split() if int(x) < 3200]
c = len(set([x // 400 for x in a]))
print(max(c, 1), c + n - len(a))


import math
N = int(input())
A = [math.floor(a / 400) if a < 3200 else 3200 for a in list(map(int, input().split()))]
set_A = set([a for a in A if a != 3200])
print(*[max(1, len(set_A)), len(set_A) + A.count(3200)], sep=' ')


n = int(input())
a = list(map(int, input().split()))
b = [0] * 9
for i in range(n):
	if a[i] < 400:
		b[0] += 1
	elif a[i] < 800:
		b[1] += 1
	elif a[i] < 1200:
		b[2] += 1
	elif a[i] < 1600:
		b[3] += 1
	elif a[i] < 2000:
		b[4] += 1
	elif a[i] < 2400:
		b[5] += 1
	elif a[i] < 2800:
		b[6] += 1
	elif a[i] < 3200:
		b[7] += 1
	else:
		b[8] += 1
min = 8 - b[:8].count(0)
max = min + b[8]
if min == 0:
	min = 1
print(min, max)


n = int(input())
a = list(map(int, input().split()))
color = []
free = 0
(Sans, Mans) = (0, 0)
for i in a:
	if i // 400 < 8 and i // 400 not in color:
		color.append(i // 400)
		Sans += 1
	elif i >= 3200:
		free += 1
Mans = Sans + free
if Sans == 0:
	Sans = 1
print(Sans, Mans)


n = int(input())
a = [int(i) // 400 for i in input().split() if int(i) < 3200]
x = len(set(a))
y = n - len(a)
if x == 0:
	print(1, y)
else:
	print(x, x + y)


n = int(input())
A = list(map(int, input().split()))
C = set()
d = 0
for a in A:
	c = a // 400
	if c < 8:
		C.add(c)
	else:
		d += 1
print(max(len(C), 1), len(C) + d)


n = input()
l = list(map(int, input().split()))
c = [0] * 8
ma = 0
for i in l:
	if i < 3200:
		c[i // 400] = 1
	else:
		ma += 1
mi = sum(c)
print(max(mi, 1), mi + ma)


n = int(input())
a = list(map(int, input().split()))
b = []
t = 0
for x in a:
	if x < 3200:
		b.append(x // 400)
	else:
		t += 1
c = len(set(b))
print(max(1, c), c + t)


N = int(input())
A = list(map(int, input().split()))
L = [0] * 9
for a in A:
	if a // 400 <= 7:
		L[a // 400] = 1
	else:
		L[8] += 1
if sum(L[:-1]) == 0:
	print(1, sum(L))
else:
	print(sum(L[:-1]), sum(L))


N = int(input())
a = [int(i) // 400 for i in input().split()]
s = set()
r = 0
for i in range(N):
	if a[i] >= 8:
		r += 1
	else:
		s.add(a[i])
print('{0} {1}'.format(max([1, len(s)]), len(s) + r))


input()
a = map(int, input().split())
c = [0] * 9
for i in a:
	c[min(8, i // 400)] += 1
s = sum((i > 0 for i in c[:8]))
print(max(s, 1), s + c[8])


n = int(input())
a = map(int, input().split())
c = [0] * 9
for i in a:
	col = i // 400
	if 3200 <= i:
		c[8] += 1
	else:
		c[col] = 1
print(max(1, sum(c[:8])), sum(c))


n = int(input())
a = list(map(int, input().split()))
s = set()
all = 0
for i in a:
	if i >= 3200:
		all += 1
		continue
	s.add(i // 400)
print(len(s) or 1, end=' ')
print(len(s) + all)


n = int(input())
a = list(map(int, input().split()))
c = [0] * 9
for i in a:
	t = i // 400
	if t < 8:
		c[t] = 1
	else:
		c[8] += 1
cmin = max(sum(c[:-1]), min(c[8], 1))
cmax = sum(c)
print(cmin, cmax)


N = int(input())
As = list(map(lambda x: int(x) // 400, input().split()))
As_other = [a for a in As if a < 8]
reds = len(As) - len(As_other)
print(max(len(set(As_other)), 1), len(set(As_other)) + reds)


n = int(input())
a = [int(i) // 400 for i in input().split()]
b = []
c = 0
for i in a:
	if i < 8:
		b.append(i)
	else:
		c += 1
b = set(b)
print(max(len(b), 1), len(b) + c)


def color(n):
	if n < 400:
		return '灰'
	elif n < 800:
		return '茶'
	elif n < 1200:
		return '緑'
	elif n < 1600:
		return '水'
	elif n < 2000:
		return '青'
	elif n < 2400:
		return '黄'
	elif n < 2800:
		return '橙'
	elif n < 3200:
		return '赤'
	else:
		return None
N = int(input())
a = list(map(int, input().split()))
colors = set()
over = 0
for c in a:
	if color(c):
		colors.add(color(c))
	else:
		over += 1
print(max(1, len(colors)), end=' ')
print(len(colors) + over)


N = int(input())
a = list(map(int, input().split()))
c = [0] * 9
for i in range(N):
	if a[i] >= 3200:
		c[8] += 1
	else:
		for j in range(8):
			if 400 * j <= a[i] and a[i] <= 400 * (j + 1) - 1:
				c[j] = 1
min1 = max(1, sum(c[:8]))
max1 = sum(c)
print(min1, max1)


_ = int(input())
a = list(map(int, input().split()))
b = set()
c = 0
for e in a:
	if e >= 3200:
		c += 1
	else:
		b.add(e // 400)
print(max(len(b), 1), len(b) + c)


N = int(input())
a = list(map(int, input().split()))
o = 0
m = 0
u = [0] * 8
for i in a:
	if 3199 < i:
		o += 1
	elif u[i // 400] == 0:
		u[i // 400] += 1
		m += 1
print(max(m, 1), m + o)


n = int(input())
a = [int(i) // 400 for i in input().split()]
s = set()
f = 0
for i in a:
	if i >= 8:
		f += 1
	else:
		s.add(i)
mn = len(s)
if len(s) == 0:
	mn += f > 0
mx = len(s) + f
print(mn, mx)


c = [0] * 9
input()
for a in map(int, input().split()):
	c[min(a // 400, 8)] += 1
b = 0
for i in range(8):
	b += 1 if c[i] > 0 else 0
print(max(b, 1), b + c[8])


n = int(input())
colors = [0] * 9
A = map(int, input().split())
for a in A:
	colors[min(a // 400, 8)] += 1
count = 8 - colors[:-1].count(0)
print(max(1, count), count + colors[-1])


(n, *a) = map(int, open(0).read().split())
x = [i // 400 for i in a if i < 3200]
ma = n - len(x) + len(set(x))
mi = len(set(x)) or 1
print(mi, ma)


n = int(input())
a = list(map(int, input().split()))
s = set()
non = 0
for x in a:
	tmp = x // 400
	if tmp < 8:
		s.add(tmp)
	else:
		non += 1
print(max(1, len(s)), len(s) + non)


n = int(input())
a = list(map(int, input().split()))
b = {}
f = 0
for i in range(n):
	if a[i] < 3200:
		b[a[i] // 400] = a[i]
	else:
		f += 1
print(max(len(b), 1), len(b) + f)


N = int(input())
A = list(map(int, input().split()))
B = set()
b = 0
for a in A:
	if a >= 3200:
		b += 1
	else:
		B.add(a // 400)
print(max(1, len(B)), len(B) + b)


N = int(input())
A = list(map(int, input().split()))
C = set()
R = 0
for a in A:
	c = a // 400 if a < 3200 else 8
	C.add(c)
	if c == 8:
		R += 1
print(len(C) - min(1, R, len(C) - 1), len(C) + max(0, R - 1))


n = int(input())
al = list(map(int, input().split()))
tl = [0] * 9
for a in al:
	if a < 3200:
		tl[a // 400] |= 1
	else:
		tl[8] += 1
print(sum(tl[0:-1]) if sum(tl[0:-1]) > 0 else 1, sum(tl))


n = int(input())
a = list(map(int, input().split()))
rates = [0] * 8
cnt = 0
for i in range(n):
	if a[i] < 3200:
		rates[a[i] // 400] += 1
	else:
		cnt += 1
cn = len(rates) - rates.count(0)
if sum(rates) == 0:
	cmin = 1
else:
	cmin = cn
if all([x < 3200 for x in a]):
	cmax = cn
else:
	cmax = cn + cnt
print(cmin, cmax)


n = int(input())
a = list(map(int, input().split()))
colors = ['灰色', '茶色', '緑色', '水色', '青色', '黄色', '橙色', '赤色', 'その他']
dic = {}
for i in colors:
	dic[i] = 0
for i in a:
	if i < 400:
		dic['灰色'] += 1
	elif i < 800:
		dic['茶色'] += 1
	elif i < 1200:
		dic['緑色'] += 1
	elif i < 1600:
		dic['水色'] += 1
	elif i < 2000:
		dic['青色'] += 1
	elif i < 2400:
		dic['黄色'] += 1
	elif i < 2800:
		dic['橙色'] += 1
	elif i < 3200:
		dic['赤色'] += 1
	else:
		dic['その他'] += 1
ans1 = 0
ans2 = 0
for i in colors:
	if i == 'その他':
		if ans1 == 0:
			ans1 = 1
			ans2 = dic[i]
			break
		ans2 += dic[i]
		continue
	if dic[i] >= 1:
		ans1 += 1
		ans2 += 1
print(ans1, ans2)