from collections import OrderedDict
rate = (
  ('gray', 400),
  ('brown', 800),
  ('green', 1200),
  ('water', 1600),
  ('blue', 2000),
  ('yellow', 2400),
  ('orange', 2800),
  ('red', 3200),
  ('rainbow', 4800),
)

n = int(input())
a = []
for i in map(int, input().split()):
  for color, border in rate:
    if i < border:
      a.append(color)
      break

rainbow = 0
colors = list(set(a))
if 'rainbow' in colors:
  rainbow = a.count('rainbow')
  colors.remove('rainbow')
print(len(colors), len(colors)+rainbow)