Problem:
 Score : 300 points    Problem Statement 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 1 4
2100 2500 2700 2700      Sample Output 1 2 2  The user with rating 2100 is "yellow", and the others are "orange". There are two different colors.       Sample Input 2 5
1100 1900 2800 3200 3200      Sample Output 2 3 5  The user with rating 1100 is "green", the user with rating 1900 is blue and the user with rating 2800 is "red". If the fourth user picks "red", and the fifth user picks "blue", there are three different colors. This is one possible scenario for the minimum number of colors. If the fourth user picks "purple", and the fifth user picks "black", there are five different colors. This is one possible scenario for the maximum number of colors.       Sample Input 3 20
800 810 820 830 840 850 860 870 880 890 900 910 920 930 940 950 960 970 980 990      Sample Output 3 1 1  All the users are "green", and thus there is one color.

Solution (Python):
n = int(input())
a = list(map(int, input().split()))

col = [0] * 8
opt = 0

for i in range(n):
    if 1 <= a[i] < 400:
        col[0] = 1
    elif 400 <= a[i] < 800:
        col[1] = 1
    elif 800 <= a[i] < 1200:
        col[2] = 1
    elif 1200 <= a[i] < 1600:
        col[3] = 1
    elif 1600 <= a[i] < 2000:
        col[4] = 1
    elif 2000 <= a[i] < 2400:
        col[5] = 1
    elif 2400 <= a[i] < 2800:
        col[6] = 1
    elif 2800 <= a[i] < 3200:
        col[7] = 1
    elif 3200 <= a[i]:
        opt += 1
if sum(col) == 0:
    print(1, opt)
else:
    print(sum(col), sum(col)+opt)

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

Solution (Python):
n = input()
rates = list(map(int, input().split()))
colors = [0, 0, 0, 0, 0, 0, 0, 0]
n_overrate = 0
n_colors = 0

for rate in rates:
    if 1 <= rate <= 399:
        colors[0] = 1
    elif 400 <= rate <= 799:
        colors[1] = 1
    elif 800 <= rate <= 1199:
        colors[2] = 1
    elif 1200 <= rate <= 1599:
        colors[3] = 1
    elif 1600 <= rate <= 1999:
        colors[4] = 1
    elif 2000 <= rate <= 2399:
        colors[5] = 1
    elif 2400 <= rate <= 2799:
        colors[6] = 1
    elif 2800 <= rate <= 3199:
        colors[7] = 1
    else:
        n_overrate += 1

sum_color = sum(colors)
if sum_color == 0:
    n_min_colors = 1
    n_max_colors = n_overrate
else:
    n_min_colors = sum_color
    n_max_colors = n_min_colors + n_overrate
print('{} {}'.format(n_min_colors, n_max_colors))

Solution (Python):
def color_judge(n):
    if 1<=n<=399:
        return 'gray'
    elif n<=799:
        return 'brown'
    elif n<=1199:
        return 'green'
    elif n<=1599:
        return 'light blue'
    elif n<=1999:
        return 'blue'
    elif n<=2399:
        return 'yellow'
    elif n<=2799:
        return 'orange'
    elif n<=3199:
        return 'red'
    else:
        return 'choice'

n = int(input())
a = list(map(int, input().split()))
dic = {}
for i in a:
    if dic.get(color_judge(i)):
        dic[color_judge(i)] += 1
    else:
        dic[color_judge(i)] = 1
choice = 0
l = len(dic)
if dic.get('choice'):
    choice = dic['choice']
    l -= 1
print(max(1, l), l+choice)

Solution (Python):
import sys,collections
input = sys.stdin.readline

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

Solution (Python):

import sys
from collections import defaultdict, deque




def solve():
    n = int(input())
    a = [int(x) for x in input().split()]
    w = set()
    c = 0
    for e in a:
        if 1 <= e <= 399:
            w.add(1)
        elif 400 <= e <= 799:
            w.add(2)
        elif 800 <= e <= 1199:
            w.add(3)
        elif 1200 <= e <= 1599:
            w.add(4)
        elif 1600 <= e <= 1999:
            w.add(5)
        elif 2000 <= e <= 2399:
            w.add(6)
        elif 2400 <= e <= 2799:
            w.add(7)
        elif 2800 <= e <= 3199:
            w.add(8)
        elif 3200 <= e:
            c += 1
    print(max(1, len(w)), len(w) + c)


t = 1

for case in range(1,t+1):
    ans = solve()

"""

"""

Solution (Python):
import sys
sys.setrecursionlimit(500000)
MOD = 10**9+7

def input():
    return sys.stdin.readline()[:-1]

def mi():
    return map(int, input().split())

def ii():
    return int(input())

def i2(n):
    tmp = [list(mi()) for i in range(n)]
    return [list(i) for i in zip(*tmp)]


def main():
    N = ii()
    a = list(mi())
    d = [0]*9
    for i in range(N):
        if a[i] < 400:
            d[0] = 1
        elif a[i] < 800:
            d[1] = 1
        elif a[i] < 1200:
            d[2] = 1
        elif a[i] < 1600:
            d[3] = 1
        elif a[i] < 2000:
            d[4] = 1
        elif a[i] < 2400:
            d[5] = 1
        elif a[i] < 2800:
            d[6] = 1
        elif a[i] < 3200:
            d[7] = 1
        else:
            d[8] += 1

    print(max(1, sum(d[:-1])), sum(d))


if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())
S = list(map(int,input().split()))

col_list = [399,799,1199,1599,1999,2399,2799,3199]
count_list = [0]*(len(col_list)+1)

for i in range(N):
    for j in range(len(col_list)+1):
        if j == len(col_list):
            if 3200<=S[i]:
                count_list[j] = count_list[j] + 1
        elif S[i]<=col_list[j]:
            count_list[j] = count_list[j]+1
            break

ans = 0
for i in range(len(col_list)):

    if count_list[i] != 0:
        ans += 1
print(str(max(ans,1)) + ' ' + str(ans+count_list[-1]))

Solution (Python):
n = int(input())
a = list(map(int, input().split()))

flag = [0]*9
t = 0
x = 0
y = 400
while y <= 3200:
  for i in a:
    if x <= i < y: flag[t] = 1
  t += 1
  x += 400
  y += 400
else:
  for i in a:
    if 3200 <= i: flag[8] += 1

if sum(flag[:8]) == 0:
  print(1,flag[8])
  exit()
      
total = sum(flag)
print(total - flag[8], total)

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

Solution (Python):
n=int(input())
lst=list(map(int,input().split()))
sp=[]
br=[]
gr=[]
cy=[]
bl=[]
yl=[]
og=[]
rd=[]
colorful=[]

for i in lst:
    if 0<=i<400:
        sp.append(i)
    elif 400<=i<800:
        br.append(i)
    elif 800<=i<1200:
        gr.append(i)
    elif 1200<=i<1600:
        cy.append(i)
    elif 1600<=i<2000:
        bl.append(i)
    elif 2000<=i<2400:
        yl.append(i)
    elif 2400<=i<2800:
        og.append(i)
    elif 2800<=i<3200:
        rd.append(i)
    else:
        colorful.append(i)

if len(colorful)==n:
    print(1,n)
else:
    mi=0
    mx=0
    if len(sp)>0:
        mi+=1
        mx+=1
    if len(br)>0:
        mi+=1
        mx+=1
    if len(gr)>0:
        mi+=1
        mx+=1
    if len(cy)>0:
        mi+=1
        mx+=1
    if len(bl)>0:
        mi+=1
        mx+=1
    if len(yl)>0:
        mi+=1
        mx+=1
    if len(og)>0:
        mi+=1
        mx+=1
    if len(rd)>0:
        mi+=1
        mx+=1
    mx+=len(colorful)
    
    print(mi,mx)

Solution (Python):
n=int(input())
a=list(map(int, input().split()))
col=[0]*9
for i in range(n):
    j=min(8, a[i]//400)
    col[j]+=1
zero=0
cnt=0
for c in range(len(col)-1):
    if col[c]==0:
        zero+=1
    else:
        cnt+=1
m=max(cnt,1)
M=cnt+col[-1]
print(m,M)

Solution (Python):
N = int(input())
a = list(map(int,input().split()))
color = [False]*8
over_human = 0
for i in a:
    if(i<=399):
        color[0]=True
    elif(i<=799):
        color[1]=True
    elif(i<=1199):
        color[2]=True
    elif(i<=1599):
        color[3]=True
    elif(i<=1999):
        color[4]=True
    elif(i<=2399):
        color[5]=True
    elif(i<=2799):
        color[6]=True
    elif(i<=3199):
        color[7]=True
    elif(i>=3200):
        over_human += 1
if(color.count(True)==0):
    print(1,color.count(True)+over_human)
else:
    print(color.count(True),color.count(True)+over_human)

Solution (Python):

n = int(input())
A = list(map(int, input().split()))


hai = 0
cha = 0
midori = 0
mizu = 0
ao = 0
ki = 0
dai = 0
aka = 0
above = 0
for a in A:
    if 1 <= a <= 399:
        hai = 1
    elif 400 <= a <= 799:
        cha = 1
    elif 800 <= a <= 1199:
        midori = 1
    elif 1200 <= a <= 1599:
        mizu = 1
    elif 1600 <= a <= 1999:
        ao = 1
    elif 2000 <= a <= 2399:
        ki = 1
    elif 2400 <= a <= 2799:
        dai = 1
    elif 2800 <= a <= 3199:
        aka = 1
    else:
        above += 1

n_rate = 8
total = hai + cha + midori + mizu + ao + ki + dai + aka

if total != 0:
    ans_min = total
else:
    ans_min = 1

ans_max = total+above

print(ans_min, ans_max)

Solution (Python):
n = int(input())
lst = list(map(int, input().split()))
rate = [400 * i for i in range(9)]
st = set()
rainbow = 0
for i in range(n):
  for j in range(8):
    if rate[j] <= lst[i] < rate[j + 1]:
      st.add(rate[j])
  if lst[i] >= 3200:
    rainbow += 1
if rainbow == n:
  print(1, n)
  exit()
print(len(st), len(st) + rainbow)

Solution (Python):
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))

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
a.sort()
ans=[0,0,0,0,0,0,0,0,0]
for i in range(n):
    if a[i]<400:
        ans[0]=1
    if 400<=a[i]<800:
        ans[1]=1
    if 800<=a[i]<1200:
        ans[2]=1
    if 1200<=a[i]<1600:
        ans[3]=1
    if 1600<=a[i]<2000:
        ans[4]=1
    if 2000<=a[i]<2400:
        ans[5]=1
    if 2400<=a[i]<2800:
        ans[6]=1
    if 2800<=a[i]<3200:
        ans[7]=1
    if 3200<=a[i]:
        ans[8]+=1
cnt=0
for i in range(8):
    if ans[i]!=0:
        cnt+=1
cnt2=cnt
if ans[8]!=0:
    cnt2=cnt+ans[8]
print(max(1,cnt),cnt2)

Solution (Python):
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))

Solution (Python):
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:]))

Solution (Python):
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)

Solution (Python):
n,*l=map(int,open(0).read().split())
s,c=set(),0
for i in l:
  if i<3200: s|={i//400}
  else: c+=1
print(max(1,len(s)),len(s)+c)

Solution (Python):
N = int(input())
lank = [0, 0, 0, 0, 0, 0, 0, 0]
a = list(map(int, input().split()))
cnt = 0

for i in range(N):
    if 1 <= a[i] <= 399:
        lank[0] = 1
    elif 400 <= a[i] <= 799:
        lank[1] = 1
    elif 800 <= a[i] <= 1199:
        lank[2] = 1
    elif 1200 <= a[i] <= 1599:
        lank[3] = 1
    elif 1600 <= a[i] <= 1999:
        lank[4] = 1
    elif 2000 <= a[i] <= 2399:
        lank[5] = 1
    elif 2400 <= a[i] <= 2799:
        lank[6] = 1
    elif 2800 <= a[i] <= 3199:
        lank[7] = 1
    else:
        cnt += 1

number_min = max(1, lank.count(1))
number_max = lank.count(1) + cnt

print(number_min, number_max)

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

Solution (Python):
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    N = I()
    a = LI()

    color = [0] * 9
    for i in a:
        if 0 <= i < 400:
            color[0] += 1
        elif 400 <= i < 800:
            color[1] += 1
        elif 800 <= i < 1200:
            color[2] += 1
        elif 1200 <= i < 1600:
            color[3] += 1
        elif 1600 <= i < 2000:
            color[4] += 1
        elif 2000 <= i < 2400:
            color[5] += 1
        elif 2400 <= i < 2800:
            color[6] += 1
        elif 2800 <= i < 3200:
            color[7] += 1
        else:
            color[8] += 1
    
    ans_min = len([i for i in color[:8] if i > 0]) 
    if ans_min == 0:
        print(1, color[8])
    else:
        print(ans_min, ans_min + color[8])

if __name__ == '__main__':
    resolve()

Solution (Python):
n = int(input())
a = map(int, input().split())

color_set = set()
color_free_num = 0
for a_i in a:
    if a_i >= 3200:
        color_free_num += 1
    else:
        color_set.add(a_i // 400)

ans_min = max(len(color_set), 1)
ans_max = len(color_set) + color_free_num
ans = "{} {}".format(ans_min, ans_max)
print(ans)

Solution (Python):


n = int(input())
a = list(map(int, input().split()))

def rank(n):
    if 1 <= n <= 399:
        return 'gray'
    elif 400 <= n <= 799:
        return 'brown'
    elif 800 <= n <= 1199:
        return 'green'
    elif 1200 <= n <= 1599:
        return 'skyblue'
    elif 1600 <= n <= 1999:
        return 'blue'
    elif 2000 <= n <= 2399:
        return 'yellow'
    elif 2400 <= n <= 2799:
        return 'orange'
    elif 2800 <= n <= 3199:
        return 'red'
    else:
        return 'others'

colors = [rank(a[i]) for i in range(n)]
numother = colors.count('others')
colors = set(colors)

if 'others' in colors:
    colors.remove('others')
    minimum = len(colors)
    tmp = minimum
    if minimum == 0:
        minimum = 1 
    maximum = tmp + numother
else:
    minimum = len(colors)
    maximum = minimum

print(minimum, maximum)

Solution (Python):
import sys
import math
import itertools as it
def I():return int(sys.stdin.readline().replace("\n",""))
def I2():return map(int,sys.stdin.readline().replace("\n","").split())
def S():return str(sys.stdin.readline().replace("\n",""))
def L():return list(sys.stdin.readline().replace("\n",""))
def Intl():return [int(k) for k in sys.stdin.readline().replace("\n","").split()]
def Lx(k):return list(map(lambda x:int(x)*-k,sys.stdin.readline().replace("\n","").split()))

def f(rate):
    global zero
    color = [400,800,1200,1600,2000,2400,2800,3200]
    for i in range(8):
        if rate < color[i]:
            return i
if __name__ == "__main__":
    cnt = [0,0,0,0,0,0,0,0]
    n = I()
    a = Intl()
    zero = 0
    ans = 0
    for i in a:
        if i < 3200:cnt[f(i)] = 1
        else:zero += 1
    
    print(max(1,sum(cnt)),sum(cnt)+zero)

Solution (Python):
n = int(input())
A = map(int, input().split())

rate = set()
free = 0
for a in A:
    if a < 3200:
        rate.add(a // 400)
    else:
        free += 1

if len(rate) == 0:
    color_min, color_max = 1, n
else:
    color_min, color_max = len(rate), len(rate) + free

print(color_min, color_max)

Solution (Python):
n = int(input())
A = tuple(map(int, input().split()))

CO = [0] * 8
o32 = 0
for a in A:
    if a >= 3200:
        o32 += 1
        continue
    for i in range(8):
        if 4*i*100 <= a < 4*(i+1)*100: 
            CO[i] += 1
ans = 0
for count in CO:
    if count > 0:
        ans += 1
print(1 if ans==0 else ans, ans+o32)

Solution (Python):
N = int(input())
A = list(map(int, input().split()))
R = [0] * 8
A.sort()
c = 0
for a in A:
    if 1 <= a < 400:
        R[0] = 1
    elif 400 <= a < 800:
        R[1] = 1
    elif 800 <= a < 1200:
        R[2] = 1
    elif 1200 <= a < 1600:
        R[3] = 1
    elif 1600 <= a < 2000:
        R[4] = 1
    elif 2000 <= a < 2400:
        R[5] = 1
    elif 2400 <= a < 2800:
        R[6] = 1
    elif 2800 <= a < 3200:
        R[7] = 1
    else:
        c += 1

if c != 0 and not 1 in R:
    mi = 1
else:
    mi = R.count(1)
ma = R.count(1) + c

print(mi, ma)

Solution (Python):
n = int(input())
a = list(map(int, input().split()))

color = [0]*8
cnt = 0
free = 0

for x in a:
    tmp = x // 400
    if tmp >= 8:
        free += 1
        continue
    if color[tmp] == 0:
        color[tmp] = 1
        cnt += 1

print(max(cnt, 1), cnt + free)

Solution (Python):
import bisect

n = int(input())
a = list(map(int,input().split()))
a.sort()
sect = 0
col = 0
for i in range(400,3201,400):
    nsect = bisect.bisect_left(a,i)
    if nsect>sect:
        sect = nsect
        col += 1
print(max(col,1),col+n-nsect)

Solution (Python):
import bisect

n = int(input())
a = list(map(int,input().split()))
a.sort()
sect = 0
col = 0
for i in range(400,3201,400):
    nsect = bisect.bisect_left(a,i)
    if nsect>sect:
        sect = nsect
        col += 1
print(max(col,1),col+n-nsect)

Solution (Python):
from collections import Counter
N = int(input())
a = [min(8, int(x) // 400) for x in input().split()]
cnt = Counter(a)

min_col = 0     
for i in range(8):
    if cnt[i]:
        min_col += 1

if min_col == 0:  
    min_col = 1
    max_col = N
else:
    max_col = min_col + cnt[8]

print(min_col, max_col)

Solution (Python):
N=int(input())
dp=[0]*9
a=list(map(int,input().split()))
for i in range(N):
  if a[i]>=3200:
    a[i]=3200
  dp[a[i]//400]+=1
s=0
for i in range(8):
  if dp[i]==0:
    s+=1
b=sum(dp[8:])
if s==8:
  print(1,b)
else:
  print(8-s,8-s+b)

Solution (Python):
n = int(input())
a = list(map(int, input().split()))

flag = [False]*8
t = 0
for i in a:
  if i < 400: flag[0] = True
  elif i < 800: flag[1] = True
  elif i < 1200: flag[2] = True
  elif i < 1600: flag[3] = True
  elif i < 2000: flag[4] = True
  elif i < 2400: flag[5] = True
  elif i < 2800: flag[6] = True
  elif i < 3200: flag[7] = True
  elif 3200 <= i: t += 1
    
minNum = 0
p = flag.count(True)
if p > 0: minNum = p
elif p == 0 and t > 0:
  minNum = 1
  
maxNum = p + t

print(minNum,maxNum)

Solution (Python):
n = int(input())
a = list(map(int, input().split()))

rate = [0 for _ in range(9)]

for i in a:
  if 1<=i<=399:
    rate[0]+=1
  elif 400<=i<=799:
    rate[1]+=1
  elif 800<=i<=1199:
    rate[2]+=1
  elif 1200<=i<=1599:
    rate[3]+=1
  elif 1600<=i<=1999:
    rate[4]+=1
  elif 2000<=i<=2399:
    rate[5]+=1
  elif 2400<=i<=2799:
    rate[6]+=1
  elif 2800<=i<=3199:
    rate[7]+=1
  else:
    rate[8]+=1
    


ans = 0

for j in range(8):
  if rate[j] != 0:
    ans += 1
if ans!=0:
  print(ans, ans+rate[8])
else:
  print(1, rate[8])

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

Solution (Python):
from collections import defaultdict

def readInt():
  return int(input())
def readInts():
  return list(map(int, input().split()))
def readChar():
  return input()
def readChars():
  return input().split()

n = readInt()
a = readInts()
rate = [0]*9


for i in a:
  rate[min(i//400,8)]+=1
base = 8-rate[:-1].count(0)
ma = base+rate[-1]
print(max(base,1),ma)

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
c=[0]*9

for r in a:
  x=r//400
  if x>8:
    x=8
  c[x]+=1
ans=0
for i in range(9):
  if i==8:
    if ans==0:
      mn=1
      mx=n
    else:
      mn=ans
      mx=ans+c[i]
  if c[i]!=0:
    ans+=1

print("{} {}".format(mn,mx))

Solution (Python):
def Judge_the_color(P):
    if P <= 399:
        return 'gray'
    elif P<=799:
        return 'brown'
    elif P<=1199:
        return 'green'
    elif P<=1599:
        return 'lightblue'
    elif P<=1999:
        return 'blue'
    elif P<=2399:
        return 'yellow'
    elif P<=2799:
        return 'orange'
    elif P<=3199:
        return 'red'
    else:
        return 'WC'

N=int(input())
aaa=list(map(int,input().split()))
l=[]

for a in aaa:
    l.append(Judge_the_color(a))

WCs=l.count('WC')

MIN=len(set(l))
MAX=len(set(l))

if MIN==1 and l[0]=='WC':
    MIN=1
elif WCs>=1:
    MIN=MIN-1
else:
    pass

if WCs>=1:
    MAX=MAX-1+WCs
else:
    pass

print(MIN,MAX)

Solution (Python):
def main():
    n = int(input())
    a = list(map(int, input().split()))

    color = [False] * 8
    over = False
    cnt_anycolor = 0

    for i in a:
        if i <= 399:
            color[0] = True
        elif i <= 799:
            color[1] = True
        elif i <= 1199:
            color[2] = True
        elif i <= 1599:
            color[3] = True
        elif i <= 1999:
            color[4] = True
        elif i <= 2399:
            color[5] = True
        elif i <= 2799:
            color[6] = True
        elif i <= 3199:
            color[7] = True
        else:
            over = True
            cnt_anycolor += 1

    min_color = 0
    max_color = 0

    for c in color:
        if c:
            min_color += 1
            max_color += 1

    if over:
        if min_color == 0:
            min_color += 1
        max_color += cnt_anycolor

    print(min_color, max_color)


if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
a = list(map(int,input().split()))

t = set()
c = 0
for i in range(n):
    if a[i] <= 399:
        t.add(1)
    elif a[i] <= 799:
        t.add(2)
    elif a[i] <= 1199:
        t.add(3)
    elif a[i] <= 1599:
        t.add(4)
    elif a[i] <= 1999:
        t.add(5)
    elif a[i] <= 2399:
        t.add(6)
    elif a[i] <= 2799:
        t.add(7)
    elif a[i] <= 3199:
        t.add(8)
    else:
        c += 1
s = len(t)
if c == 0:
    print(s,s)
else:
    if s == 0:
        print(1,c)
        exit()
    print(s,s+c)

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
color_val=0
bigList=[]
for i in range(1,400):
  if i in a:
    color_val+=1
    break
for s in range(400,800):
  if s in a:
    color_val+=1
    break
for t in range(800,1200):
  if t in a:
    color_val+=1
    break
for u in range(1200,1600):
  if u in a:
    color_val+=1
    break
for q in range(1600,2000):
  if q in a:
    color_val+=1
    break
for e in range(2000,2400):
  if e in a:
    color_val+=1
    break
for f in range(2400,2800):
  if f in a:
    color_val+=1
    break
for g in range(2800,3200):
  if g in a:
    color_val+=1
    break
for z in a:
  if z >=3200:
    bigList.append(z)
    
max=color_val+len(bigList)
if color_val!=0:
  print(color_val,max)
else:
  print(1,max)

Solution (Python):
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))

Solution (Python):
_ = 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)

Solution (Python):
_ = input()
a = [int(x) for x in input().split()]

p = [False] * 8
q = 0
for i in a:
    if 3199 < i:
        q += 1
    else:
        for j in range(8):
            if 400 * j <= i < 400 * (j + 1):
                p[j] = True
else:
    s = sum(p)
    print(max(s, 1), s + q)

Solution (Python):
import collections

n = int(input())
a = list(map(int, input().split(' ')))


def color(rate):
    if 1 <= rate <= 399:
        return 'gray'
    elif 400 <= rate <= 799:
        return 'brown'
    elif 800 <= rate <= 1199:
        return 'green'
    elif 1200 <= rate <= 1599:
        return 'water'
    elif 1600 <= rate <= 1999:
        return 'blue'
    elif 2000 <= rate <= 2399:
        return 'yellow'
    elif 2400 <= rate <= 2799:
        return 'orange'
    elif 2800 <= rate <= 3199:
        return 'red'
    elif 3200 <= rate:
        return 'multi'


MAX_COLORS = 8

l = [color(rate) for rate in a]
c = collections.Counter(l)


k_not_multi = len([k for k in c.keys() if k != 'multi'])
multis = c['multi']

_max = multis + k_not_multi

if k_not_multi == 0:
    _min = 1
else:
    _min = k_not_multi
    
    
    
    
    
    
    
    



print(_min, _max)

Solution (Python):
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)

Solution (Python):
def main():
    is_exist = [False] * 8
    free = 0
    n = int(input())
    A = list(map(int, (input().split())))
    for a in A:
        color = a // 400
        if color >= 8:
            free += 1
        else:
            is_exist[color] = True

    normal_colors = sum(is_exist)
    minimum = normal_colors
    if not minimum and free:
        minimum = 1

    maximum = free + normal_colors
    print(minimum, maximum)


if __name__ == "__main__":
    main()

Solution (Python):
N = int(input())
A = list(map(int, input().split()))
B = []
C = 0
for i in range(N):
  if A[i]//400 < 8:
    B.append(A[i]//400)
  else:
    C += 1
b = set(B)
if len(b) == 0:
  print(1, C)
else:
  print(len(b), len(b)+C)

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
a=list(map(lambda x:x//400,a))
cnt=0
z=[]
for i in a:
  if i>=8:
    cnt+=1
  else:
    z.append(i)
print(max(1,len(set(z))),len(set(z))+cnt)

Solution (Python):
N = int(input())
a = list(map(int, input().split()))
l = [0, 0, 0, 0, 0, 0, 0, 0]
pro = 0
m1 = 0
m2 = 0

for i in a:
    if i < 400:
        l[0] += 1
    elif 400 <= i and i < 800:
        l[1] += 1
    elif 800 <= i and i < 1200:
        l[2] += 1
    elif 1200 <= i and i < 1600:
        l[3] += 1
    elif 1600 <= i and i < 2000:
        l[4] += 1
    elif 2000 <= i and i < 2400:
        l[5] += 1
    elif 2400 <= i and i < 2800:
        l[6] += 1
    elif 2800 <= i and i < 3200:
        l[7] += 1
    elif 3200 <= i:
        pro += 1

if l != [0, 0, 0, 0, 0, 0, 0, 0]:
    for i in l:
        if i != 0:
            m1 += 1
    m2 = m1 + pro
else:
    m1 = 1
    m2 = pro


print(m1, m2)

Solution (Python):
n = int(input())
A = list(map(int,input().split()))

col = [0 for _ in range(9)]
for a in A:
  if a >= 3200:
    col[8] += 1
    continue
  col[a//400] = 1
  
ans_min = sum(col[:-1])
if ans_min == 0 and col[-1] != 0:
  ans_min = 1
print(ans_min, sum(col))

Solution (Python):
def resolve():
    n = int(input())
    a = list(map(int, input().split()))

    ll = [0] * 9
    for aa in a:
        if 3200 <= aa:
            ll[0] += 1
            continue
        for i in range(1,9):
            if aa < 400 * i:
                ll[i] += 1
                break
    mn = sum([i > 0 for i in ll[1:]])
    mx = mn + ll[0]
    mn = max(int(ll[0] > 0), mn)

    print(mn, mx)


if __name__ == "__main__":
    resolve()

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
a.sort()
l = [x//400 if x//400 <= 7 else 8 for x in a]
p = [0]*8
for i in l:
    if i < 8:
        p[i] = 1
pmin = sum(p) if sum(p) != 0 else 1
pmax = sum(p) + l.count(8)
print(pmin, pmax)

Solution (Python):
n = int(input())

a = [int(x) for x in input().split()]

b = [0] * 9
for i in range(n):
    if a[i] // 400 < 8:
        b[a[i] // 400] += 1
    else:
        b[8] += 1

minsum = 0
maxsum = 0

for i in range(8):
    if b[i] > 0:
        minsum += 1

maxsum = minsum
maxsum += b[8]

if minsum == 0:
    minsum = 1

print("{} {}".format(minsum, maxsum))

Solution (Python):
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)

Solution (Python):
n = int(input())
a = list(map(int,input().split()))
c = [0,0,0,0,0,0,0,0]
at = 0
for i in range(n):
    if 1<=a[i]<=399:
        c[0]+=1
    elif 400<=a[i]<=799:
        c[1]+=1
    elif 800<=a[i]<=1199:
        c[2]+=1
    elif 1200<=a[i]<=1599:
        c[3]+=1
    elif 1600<=a[i]<=1999:
        c[4]+=1
    elif 2000<=a[i]<=2399:
        c[5]+=1
    elif 2400<=a[i]<=2799:
        c[6]+=1
    elif 2800<=a[i]<=3199:
        c[7]+=1
    else:
        at+=1
cnt=0
for i in c:
    if i >0:
        cnt+=1
ans_max=cnt+at 

if cnt==0:
    cnt=1
print(str(cnt)+" "+str(ans_max))

Solution (Python):
import sys

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def main():
    n = I()
    a = LI()
    color = 8
    free = 0
    flag = [False]*color
    for ai in a:
        if ai >= 3200:
            free += 1
        else:
            flag[ai//400] = True
    color_min = max(1, sum(flag))
    color_max = sum(flag)+free
    print("{} {}".format(color_min, color_max))

if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
a = list(map(int, input().split()))

l = [0]*9
for i in a:
    if 1<=i<=399:
        l[0] = 1
    elif 400<=i<=799:
        l[1] = 1
    elif 800<=i<=1199:
        l[2] = 1
    elif 1200<=i<=1599:
        l[3] = 1
    elif 1600<=i<=1999:
        l[4] = 1
    elif 2000<=i<=2399:
        l[5] = 1
    elif 2400<=i<=2799:
        l[6] = 1
    elif 2800<=i<=3199:
        l[7] = 1
    else:
        l[8] += 1
ls = l[:8]

if sum(ls) == 0:
    print(1, l[8])
else:
    print(sum(ls), sum(l))

Solution (Python):
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)))

Solution (Python):
N = int(input())
A = list(map(int, input().split()))

x = [0]*8
god = 0
for a in A:
    for i in range(8):
        if a < 400*(i+1):
            x[i] = 1
            break
    else:
        god += 1

res = sum(x)
print(max(res, 1), res+god)

Solution (Python):
N=int(input())
a=list(map(int,input().split()))
color=[0]*9
ac=0
for i in range(N):
    rate=min(a[i]//400,8)
    color[rate]+=1
for i in range(8):
    if color[i]>=1:
        ac+=1
min_ans=max(ac,1)
max_ans=ac+color[8]
print(min_ans,max_ans)