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 = 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
if sum(l[:8]) == 0:
    print(1, sum(l))
else:
    print(sum(l[:8]), sum(l))

Solution (Python):

import numpy as np
n = int(input())
a = np.array(list(map(int, input().split())))
b = sorted (a//400)
cnt = 0
for i in range(len(b)):
    if b[i]  < 8:
        None
    else:
        b[i]+=i
        cnt+=1
c = len(list(set(b)))

print(str(max([1,c-cnt])) + " " + str(c))

Solution (Python):

import numpy as np

def mapper(x): 
    if x >= 3200:
        return -1;
    else:
        return x // 400

n = input()
stage = np.array(list(map(int, input().split())))

r = np.count_nonzero(np.vectorize(mapper)(stage) == -1)
s = len(set(np.vectorize(mapper)(stage).tolist())-set([-1]))

print(max(s,1), s+r)

Solution (Python):

import math
import sys
import itertools
import numpy as np

def mapper(x): 
    if x >= 3200:
        return -1;
    else:
        return x // 400

n = input()


stage = np.array(list(map(int, input().split())))


r = np.count_nonzero(np.vectorize(mapper)(stage) == -1)


s = len(set(np.vectorize(mapper)(stage).tolist())-set([-1]))

print(max(s,1), s+r)

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

for a in A:
    m = a // 400
    if m >= 8:
        m = 8
    d[m] = d.get(m, 0) + 1

minans = 0
for i in range(8):
    if i in d:
        minans += 1
if minans == 0:
    print("{} {}".format(1, N))
    exit()
maxans = minans + d.get(8, 0)
print("{} {}".format(minans, maxans))

Solution (Python):
N = int(input())
A = [int(i) for i in input().split()]
     
flg = [0,0,0,0,0,0,0,0,0]
for i in range(N):
    if   A[i] <  400: flg[0] = 1
    elif A[i] <  800: flg[1] = 1
    elif A[i] < 1200: flg[2] = 1
    elif A[i] < 1600: flg[3] = 1
    elif A[i] < 2000: flg[4] = 1
    elif A[i] < 2400: flg[5] = 1
    elif A[i] < 2800: flg[6] = 1
    elif A[i] < 3200: flg[7] = 1
    else:             flg[8] += 1
     
colmin = max(sum(flg[0:8]), 1)
colmax = sum(flg)
print(colmin, colmax)

Solution (Python):
N = int(raw_input())
a = raw_input()

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

max = 0
min = 0
for i in range(9):
	max = max + c[i]

min = max - c[8]
if min == 0:
	min = 1
print min,
print max

Solution (Python):
import numpy as np

N=int(input())
arr=[int(i) for i in input().split()]


binCount=np.zeros(9)
for rate in arr:
    rateBin=rate//400
    binCount[min(rateBin,8)]+=1

colorCount=int(np.sum(binCount[:-1]>0))
nc=int(np.sum(binCount[:-1]))
nf=int(binCount[-1])
assert N==(nc+nf)

if nc>0:
    minColor=colorCount
elif nf>0:
    minColor=1
else:
    minColor=0

maxColor=int(colorCount+nf)
print(minColor, maxColor)

Solution (Python):
N = int(input())
A = [int(i) for i in input().split()]

flg = [0,0,0,0,0,0,0,0,0]
for i in range(N):
    if   A[i] <  400: flg[0] = 1
    elif A[i] <  800: flg[1] = 1
    elif A[i] < 1200: flg[2] = 1
    elif A[i] < 1600: flg[3] = 1
    elif A[i] < 2000: flg[4] = 1
    elif A[i] < 2400: flg[5] = 1
    elif A[i] < 2800: flg[6] = 1
    elif A[i] < 3200: flg[7] = 1
    else:             flg[8] += 1

colmin = max(sum(flg[0:8]), 1)
colmax = sum(flg)
print(colmin, colmax)

Solution (Python):
import sys
 
stdin = sys.stdin
 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()
 
n = ni()
a = na()
f = [0]*8
sp = 0
for v in a:
    if v >= 3200:
        sp += 1
    else:
        f[v//400] = 1
        
if sum(f) > 0:
    print("{} {}".format(sum(f), sum(f)+sp))
else:
    print("{} {}".format(sum(f)+min(sp,1), sum(f)+sp))

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

b = [0, 0, 0, 0, 0, 0, 0, 0]
c = 0

for i in a:
	if i < 3200:
		b[int(i / 400)] = 1
	else:
		c += 1

s = sum(b)
if s == 0:
	s = 1

print s, sum(b) + c

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

c = [0] * 8
max = 0
for i in a:
    if i >= 3200:
        max += 1
    else:
        c[i // 400] = 1

min = 0
for i in range(8):
    if c[i] != 0:
        min += 1

max += min
if min == 0:
    print(1, max)
else:
    print(min, max)

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

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

min = 0
for i in range(8):
    if c[i] != 0:
        min += 1

max += min
if min == 0:
    print(1, max)
else:
    print(min, max)

Solution (Python):
def get_color_type_num(a_list):

    c_list = [0 for i in range(9)]

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

    c_num = 0
    c_free = c_list[8]
    for i, c in enumerate(c_list):
        if i == 8:
            c_free = c
        elif c:
            c_num += 1

    min_c = c_num
    max_c = min_c + c_free
    
    
    if min_c == 0:
        min_c = 1

    return min_c, max_c


if __name__ == '__main__':
    N = input()
    a_list = [int(i) for i in input().split()]

    min_c, max_c = get_color_type_num(a_list)
    print(min_c, max_c)

Solution (Python):

    
    
    
    
    
    
    
    

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

Solution (Python):

    
    
    
    
    
    
    
    

import numpy as np
n = input()
a = np.array(list(map(int, input().split())))
a = a // 400
b = set()
sa = 0
ans = 0
for i in a:
    if i >= 8:
        sa+=1
    else:
        b.add(i)

print(len(b) if len(b) != 0 else 1, len(b)+sa)

Solution (Python):

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


g_list = [0]*9


for i in range(N):
    if 1 <= a_list[i] <= 399:
        g_list[0] = 1
        break


for j in range(1,8):
    for k in range(N):
        if 400*j <= a_list[k] <= (400*(j+1)-1):
            g_list[j] = 1
            break


g = 0
for m in range(8):
    g += g_list[m] 


g_list[8] = 0
for l in range(N):
    if a_list[l] >= 3200:
        g_list[8] += 1


if g_list[8]==0:
    print(g,g)

elif g==0:
    print(1,g_list[8])

else:
    print(g,g+g_list[8])

Solution (Python):
import numpy as np
n=input()
n=int(n)
a=input().split()
b=np.zeros(n)
div=0
num_8=0
for i in range(n):
 a[i]=int(a[i])
 if a[i]<=399 and a[i]>=1:
  b[i]=0
 elif a[i]>=400 and a[i]<=799:
  b[i]=1
 elif a[i]>=800 and a[i]<=1199:
  b[i]=2
 elif a[i]>=1200 and a[i]<=1599:
  b[i]=3
 elif a[i]>=1600 and a[i]<=1999:
  b[i]=4
 elif a[i]>=2000 and a[i]<=2399:
  b[i]=5
 elif a[i]>=2400 and a[i]<=2799:
  b[i]=6
 elif a[i]>=2800 and a[i]<=3199:
  b[i]=7
 else:
  b[i]=8
  num_8=num_8+1
for i in range(8):
 if i in b:
  div=div+1
min=div
max=div+num_8
if min==0:
 min=1
print(min,max)

Solution (Python):
n = input()
a = list(map(int, input().split()))
count = [0] * 9
for i in a:
    if i < 3200:
        count[i//400] = 1
    else:
        count[8] += 1
ansMax = sum(count)
ansMin = sum(count[:8])
if ansMin==0 and count[8] > 0:
    ansMin = 1
print(ansMin, ansMax)

Solution (Python):
number = int(input())
rate = [int(i) for i in input().split()]




counter = {}
for r in rate:
    if 1 <= r < 400:
        counter["grey"] = counter.get("grey", 0) + 1
    if 400 <= r < 800:
        counter["brown"] = counter.get("brown", 0) + 1
    if 800 <= r < 1200:
        counter["green"] = counter.get("green", 0) + 1
    if 1200 <= r < 1600:
        counter["sky"] = counter.get("sky", 0) + 1
    if 1600 <= r < 2000:
        counter["blue"] = counter.get("blue", 0) + 1
    if 2000 <= r < 2400:
        counter["yellow"] = counter.get("yellow", 0) + 1
    if 2400 <= r < 2800:
        counter["orange"] = counter.get("orange", 0) + 1
    if 2800 <= r < 3200:
        counter["red"] = counter.get("red", 0) + 1
    if 3200 <= r:
        counter["color"] = counter.get("color", 0) + 1

answer = 0
for k, v in counter.items():
    if not v == 0:
        answer += 1
        
if counter.get("color", 0) == 0:
    print(str(answer) + " " + str(answer))
else:
    if answer == 1:
        print("1 " + str(counter["color"]))
    else:
        print(str(answer-1) + " " + str(answer-1+counter["color"]))

Solution (Python):
import sys


if __name__ == "__main__":
    N = int(input())

    rates = map(int, raw_input().split())
    

    
    normal_colors = int(3200/400)
    colors = [0] * normal_colors
    aaa = 0
    for rate in rates:
        if rate >= 3200:
            aaa +=1
        else:
            colors[rate/400] = 1

    print max(sum(colors),1), sum(colors)+aaa

Solution (Python):










x = int(input())
y = input().split()

gray = 0
brown = 0
green = 0
skyblue = 0
blue = 0
yellow = 0
orange = 0
red = 0
other = 0

for i in range(x):
    z = int(y[i]) 
    if z < 400:
       gray = 1 
    elif z < 800:
        brown = 1
    elif z < 1200:
        green = 1
    elif z < 1600:
        skyblue = 1
    elif z < 2000:
        blue = 1
    elif z < 2400:
        yellow = 1
    elif z < 2800:
        orange = 1
    elif z < 3200:
        red = 1
    else:
        other = other + 1

if other >= 1:
    ans_max = gray + brown + green + skyblue + blue + yellow + orange + red + other
    ans_min = gray + brown + green + skyblue + blue + yellow + orange + red + 0
    
    if ans_min == 0:
        ans_min = 1
    
    print(str(ans_min) + " " + str(ans_max))

else:
    ans = gray + brown + green + skyblue + blue + yellow + orange + red + other
    
    print(str(ans) + " " + str(ans))

Solution (Python):
N = input()
a = input().split()
scores = [0,0,0,0,0,0,0,0]
score8 = 0
for i in a:
    check = int(int(i) / 400)
    if check > 7:
        score8 += 1
    else:
        scores[check] = 1
score1to7 = sum(scores)
saidai = score1to7 + score8
if score1to7 < 1:
    saisho = 1
else:
    saisho = score1to7
print(str(saisho) + " " + str(saidai))

Solution (Python):
N = input()
a = []
a.append(map(int, raw_input().split()))

a=a[0]

c=[0,0,0,0,0,0,0,0]

free=0

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

ma=sum(c)+free



mi=sum(c)
if mi<1:
    mi=1


print(str(mi) + " " + str(ma))

Solution (Python):


import sys
import math

N, = map(int, sys.stdin.readline().rstrip().split())
a_list = list(map(int, sys.stdin.readline().rstrip().split()))

def score_index(score):
    if score < 400:
        return 0
    if score < 800:
        return 1
    if score < 1200:
        return 2
    if score < 1600:
        return 3
    if score < 2000:
        return 4
    if score < 2400:
        return 5
    if score < 2800:
        return 6
    if score < 3200:
        return 7
    else:
        raise Exception()



superplayers = 0
counts = set()
for a in a_list:
    if a < 3200:
        counts.add(score_index(a))
    else:
        superplayers += 1

print("{} {}".format(
    max(len(counts), 1),
    len(counts) + superplayers
))

exit(0)

Solution (Python):
N=input()
def waru(num):
    return int(num)//400
a = list(map(waru, input().split()))
b = []
num = 0
for i in a:
    if i >= 8:
        b.append(i)
minu = len(set(a)) - len(set(b))
if minu==0:
    minu = 1
    maxi = len(b)
else:
    maxi = len(b)+minu
print(minu, maxi)

Solution (Python):
N=input()
nlist= [int(l) for l in raw_input().split(' ')]

rate= [0,0,0,0,0,0,0,0]
up = 0
for n in nlist:
	if n/400>=8:
		up += 1
	else:
		rate[n/400]=1

print max(1,sum(rate)),sum(rate)+up

Solution (Python):


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

r1_399 = 0
r400_799 = 0
r800_1199 = 0
r1200_1599 = 0
r1600_1999 = 0
r2000_2399 = 0
r2400_2799 = 0
r2800_3199 = 0
over3200 = 0

for i in p:
    if 1 <= i <400:
        r1_399 +=1
    elif 400 <= i <800:
        r400_799 +=1
    elif 800 <= i <1200:
        r800_1199 +=1
    elif 1200 <= i <1600:
        r1200_1599 +=1
    elif 1600 <= i <2000:
        r1600_1999 +=1
    elif 2000 <= i <2400:
        r2000_2399 += 1
    elif 2400 <= i < 2800:
        r2400_2799 += 1
    elif 2800<= i <3200:
        r2800_3199 += 1
    elif 3200<= i:
        over3200 += 1
num = 0
for i in [r1_399,r400_799,r800_1199,r1200_1599,r1600_1999,r2000_2399,r2400_2799,r2800_3199]:
    if i > 0:
        num+=1

nummax = num + over3200

if num == 0:
    num +=1
print(str(num)+" " +str(nummax))

Solution (Python):
n = int(input())
a = [ int(i) for i in input().split() ]
c = [ 0 for _ in range(8)]
cou = 0

for i in range(n):
    keep=a[i]

    if 1<= keep <=399:
        c[0]=1
    elif 400<= keep <=799:
        c[1]=1
    elif 800<= keep <=1199:
        c[2]=1
    elif 1200<= keep <=1599:
        c[3]=1
    elif 1600<= keep <=1999:
        c[4]=1
    elif 2000<= keep <=2399:
        c[5]=1
    elif 2400<= keep <=2799:
        c[6]=1
    elif 2800<= keep <=3199:
        c[7]=1
    else:
        cou += 1

MAX = MIN = c.count(1)
MAX += cou
MIN = max(MIN,1)


print(MIN,MAX)

Solution (Python):

N=input()

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

Rate = []
for i in range(9):
    Rate.append(0)

for i in A:
    index=i//400
    if index > 8:
        index = 8
    Rate[index] = Rate[index] + 1

a = 0

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

Max = a + Rate[8]
Min = max(a, 1)

print(Min, Max)

Solution (Python):
import math
N=input()

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

Rate = []
for i in range(9):
    Rate.append(0)

for i in A:
    index=math.floor(i/400)
    if index > 8:
        index = 8
    Rate[index] = Rate[index] + 1

a = 0

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

Max = a + Rate[8]
Min = max(a, 1)

print(Min, Max)

Solution (Python):
N = int(input())
a = list(map(int, input().split()))
mi = 0
ma = 0
border = [1, 400, 800, 1200, 1600, 2000, 2400, 2800, 3200, 4801]
num = [0 for i in range(9)]
for i in a:
    for j in range(len(border[0:-1])):
        if(border[j] <= i and i < border[j+1]):
            num[j] += 1

for i in num[0:-1]:
    if(i > 0):
        mi += 1
        ma += 1

mi = max(1, mi)
ma = ma+num[-1]
print(mi, ma)

Solution (Python):
import math

N=int(input())
s = list(map(int,input().split()))
c = []

for i in range(9):
    c.append(0)

for i in s:
    ii = math.floor(i / 400)
    if ii > 8:
        ii = 8
    c[ii] = c[ii] + 1

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

b = a + c[8]
a = max(a, 1)

print(a, b)

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

flag1 = True
flag2 = True
flag3 = True
flag4 = True
flag5 = True
flag6 = True
flag7 = True
flag8 = True

Max = 0
Min = 0

for value in l:
	if 1 <= value and value < 400 and flag1 == True:
		flag1 = False
		Max += 1
		Min += 1
	elif 400 <= value and value < 800 and flag2 == True:
		flag2 = False
		Max += 1
		Min += 1
	elif 800 <= value and value < 1200 and flag3 == True:
		flag3 = False
		Max += 1
		Min +=1
	elif 1200 <= value and value < 1600 and flag4 == True:
		flag4 = False
		Max += 1
		Min += 1
	elif 1600 <= value and value < 2000 and flag5 == True:
		flag5 = False
		Max += 1
		Min += 1
	elif 2000 <= value and value < 2400 and flag6 == True:
		flag6 = False
		Max += 1
		Min += 1
	elif 2400 <= value and value < 2800 and flag7 == True:
		flag7= False
		Max += 1
		Min += 1
	elif 2800 <= value and value < 3200 and flag8 == True:
		flag8 = False
		Max += 1
		Min += 1
	elif 3200 <= value and value <= 4800:
		Max += 1

if Min == 0:
	Min = 1

print(str(Min) + " " + str(Max))

Solution (Python):

N=int(input())

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

color=[0,0,0,0,0,0,0,0]
alles=0

for i in range(N) :
    
    if a[i]<400 :
        color[0]+=1
    elif a[i]<800 :
        color[1]+=1
    elif a[i]<1200 :
        color[2]+=1
    elif a[i]<1600 :
        color[3]+=1
    elif a[i]<2000 :
        color[4]+=1
    elif a[i]<2400 :
        color[5]+=1
    elif a[i]<2800 :
        color[6]+=1
    elif a[i]<3200 :
        color[7]+=1
    else :
        alles+=1

        
while 0 in color :color.remove(0)


if len(color)==0 :
    print(int(1)," ",len(color)+alles)
else :
    print(len(color)," ",len(color)+alles)

Solution (Python):
def f(A):
    counter = [0 for _ in range(8)]
    n_free = 0
    for a in A:
        if a >= 3200:
            n_free += 1
        else:
            idx = a // 400
            counter[idx] += 1
    if sum(counter) > 0:
        n_min = sum(count > 0 for count in counter)
        n_max = n_min + n_free
    else:
        n_min = 1
        n_max = n_free
    return n_min, n_max

N = int(input())
A = list(map(int, input().split()))
n_min, n_max = f(A)
print("{} {}".format(n_min, n_max))

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

d = [0] * 9
for i in a:
    if i <= 399:
        d[0] = 1
    elif i <= 799:
        d[1] = 1
    elif i <= 1199:
        d[2] = 1
    elif i <= 1599:
        d[3] = 1
    elif i <= 1999:
        d[4] = 1
    elif i <= 2399:
        d[5] = 1
    elif i <= 2799:
        d[6] = 1
    elif i <= 3199:
        d[7] = 1
    else:
        d[8] += 1

minimam = max(1, sum(d[:8]))
maximam = sum(d)

print(minimam, maximam)

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

Solution (Python):

N = int(raw_input())
rates = map(int, raw_input().split(' '))

colors = [0 for _ in range(8)]
top = 0
for r in rates:
	mod = r / 400
	if mod < 8:
		colors[mod] = 1
	else:
		top += 1	

minnum = sum(colors)
maxnum = minnum + top
if minnum == 0:
	minnum = 1
print '{} {}'.format(minnum, maxnum)

Solution (Python):


N = int(input())
a = input().split()

gray = 0
brown = 0
green = 0
sky = 0
blue = 0
yellow = 0
orange = 0
red = 0
other = 0
for i in range(N):
	a[i] = int(a[i])

	if 1 <= a[i] and a[i] <= 399:
		gray = 1
	elif 400 <= a[i] and a[i] <= 799:
		brown = 1
	elif 800 <= a[i] and a[i] <= 1199:
		green = 1
	elif 1200 <= a[i] and a[i] <= 1599:
		sky = 1
	elif 1600 <= a[i] and a[i] <= 1999:
		blue = 1
	elif 2000 <= a[i] and a[i] <= 2399:
		yellow = 1
	elif 2400 <= a[i] and a[i] <= 2799:
		orange = 1
	elif 2800 <= a[i] and a[i] <= 3199:
		red = 1
	elif 3200 <= a[i]:
		other = other + 1

sum = gray + brown + green + sky + blue + yellow + orange + red

if sum > 1:
	min = sum
else:
	min = 1

max = sum + other

print(str(min) + " " + str(max))

Solution (Python):
n = int(input())
aa = [min(8, int(a) // 400) for a in input().split()]
over3200 = aa.count(8)
colors = len(set(aa))
_min = colors - 1 if over3200 and n > over3200 else colors
_max = colors + over3200 - 1 if over3200 else colors
print(_min, _max)

Solution (Python):
N = int(input())
a = list(map(int,input().split()))
c = []
d = []
for j in range(N):
  for i in range(0,8):
    if 400*(i) <= a[j] < 400*(i+1):
       if i not in c:
           c.append(i)
  if a[j] >= 3200:
        d.append(a[j])
if len(c) ==0:
    print(1,len(d))
else:
    print(len(c),len(c)+len(d))

Solution (Python):
N = int(input())
a = [int(i) for i in input().split()]

color = [0] * 8
over = 0

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

mini = color.count(1)
maxi = color.count(1)

if over >= 1:
    if mini == 0:
        mini = 1

    maxi += over

print(mini, maxi)

Solution (Python):
n = int(raw_input())
l = map(int, raw_input().split())
ll = [False for _ in range(8)]
o = 0
for i in l:
    if i/400 < 8:
        ll[i/400] = True
    else:
        o += 1
c = ll.count(True)
if c == 0:
    print 1,o
else:
    print c,c+o

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

GRAY = 400
BROWN = 800
GREEN = 1200
CYAN = 1600
BLUE = 2000
YELLOW = 2400
ORANGE = 2800
RED = 3200

colors = []
over3200 = 0

for i in a:
    if i < GRAY:
        colors.append(GRAY)
    elif i < BROWN:
        colors.append(BROWN)
    elif i < GREEN:
        colors.append(GREEN)
    elif i < CYAN:
        colors.append(CYAN)
    elif i < BLUE:
        colors.append(BLUE)
    elif i < YELLOW:
        colors.append(YELLOW)
    elif i < ORANGE:
        colors.append(ORANGE)
    elif i < RED:
        colors.append(RED)
    else:
        over3200 += 1

colornum = len(set(colors))
mincolor = max(colornum, 1)
maxcolor = colornum + over3200

print(' '.join([str(mincolor),str(maxcolor)]))

Solution (Python):
N=int(input())
a_n=[]
a2_n=[]
a_n = input().split(" ")
count = 0

for i in range(N):
    if int(a_n[i])/400 < 8:
         a2_n.append(int(a_n[i])//400)
    else:
        count += 1

n_min = len(set(a2_n))
n_max = n_min+count

print(max(1, n_min),n_max)

Solution (Python):

import sys

N = input()
an = input()
lit = sorted(map(int, an.split()))
color = {}

for i in range(400, 3201, 400):
    color[i] = list(filter(lambda x: i-400 <= x <i , lit))
rainbow = list(filter(lambda x: x>=3200, lit))
label = 0

for v in color.values():
    if len(v) != 0:
        label += 1
        
if label == 0 and len(rainbow) > 0:
    print('1 {}'.format(len(rainbow)))
else:
    print('{} {}'.format(label, label + len(rainbow)))

Solution (Python):
import numpy as np
N = int(input())
a = [int(_) for _ in input().split()]
a = np.array(a)
a = np.sort(a)
min = 0
max = 100

for i in range(8):
    set_1 = set(np.where(i*400<=a)[0])
    set_2 = set(np.where(a<(i+1)*400)[0])
    match = list(set_1 & set_2)
    if len(match)>0:
        min+=1
if min==0:
    min=1
    max = N
else:
    if len(np.where(a>=3200)[0])==0:
        max = min
    else:
        max = min + len(np.where(a>=3200)[0])
print (min, max)

Solution (Python):
import sys
from collections import Counter




def is_not_zero(x):
    if x != 0:
        return True
    else:
        return False


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

for x in a:
    for l in range(0, 3600, 400):
        if x < l:
            c[l] += 1

g = []
for l in range(400, 3600, 400):
    g.append(c[l] - c[l - 400])
r = n - sum(g)



res = [0, 0]

non_zero = list(filter(is_not_zero, g))
if len(non_zero) == 0:
    res[0] = 1
    res[1] = r
if len(non_zero) > 0:
    res[0] = len(non_zero)
    res[1] = len(non_zero) + r
print(res[0], res[1])

Solution (Python):
N = int(input())
a = [int(n) for n in input().split()]

colors = [0,0,0,0,0,0,0,0]
free = 0

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

s = sum(colors)

print(str(max(s, 1)) + " " + str(s + free))

Solution (Python):


N = int(input())
a = list(map(int, input().split()))
flag = [0]*9
ans = 0
ans_max =0
for i in range(N):
    num = a[i]//400
    if num>=8:
        flag[8]+=1
    else:
        flag[num]=1
ans = sum(flag[:-1])
if ans == 0:
    ans =1
    ans_sum = flag[8]
else: 
    ans_sum= ans+flag[8]
    
print(ans, ans_sum)

Solution (Python):
def read(): return list(map(int, input().split()))


n = int(input())
a = read()

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

s = sum(c[:8])
mini = 1 if s < 1 else s
maxi = s + c[8]
print("{} {}".format(mini, maxi))

Solution (Python):
def get_color(rating):
    return rating / 400

N = input()
a = map(int, raw_input().split())
colors = [get_color(a[i]) for i in range(N)]

S, cnt = set(), 0
for c in colors:
    if c < 8:
        S.add(c)
    else:
        cnt += 1
print max(len(S), 1), (len(S) + cnt)

Solution (Python):




color_list = [0] * 9


def check_color(a):
    if a <= 399:
        return 0
    elif (a >= 400) & (a <=799):
        return 1
    elif (a >= 800) & (a <=1199):
        return 2
    elif (a >= 1200) & (a <=1599):
        return 3
    elif (a >= 1600) & (a <=1999):
        return 4
    elif (a >= 2000) & (a <=2399):
        return 5
    elif (a >= 2400) & (a <=2799):
        return 6
    elif (a >= 2800) & (a <=3199):
        return 7
    elif (a >= 3200):
        return 8


N = int(input())
a_list = list(map(int, input().split()))


ans = 0
for i in range(len(a_list)):
    n = check_color(a_list[i])
    if (color_list[n] == 0) & (n <= 7):
        ans += 1
    color_list[n] += 1

min = ans
if (min == 0):
    min = 1
max = ans + color_list[8]
print (str(min) + " " + str(max))

Solution (Python):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()


def main():
    n = I()
    a = LI()
    d = set()
    t = 0
    for c in a:
        if c >= 3200:
            t += 1
        else:
            d.add(c//400)
    l = len(d)
    return '{} {}'.format(max(l,1),l+t)


print(main())

Solution (Python):


def get_index(rate):
    if 1 <= rate <= 399:
        return 0
    elif 400 <= rate <= 799:
        return 1
    elif 800 <= rate <= 1199:
        return 2
    elif 1200 <= rate <= 1599:
        return 3
    elif 1600 <= rate <= 1999:
        return 4
    elif 2000 <= rate <= 2399:
        return 5
    elif 2400 <= rate <= 2799:
        return 6
    elif 2800 <= rate <= 3199:
        return 7

if __name__ == "__main__":
    N = int(input())
    rates = list(map(int, input().split(" ")))
    color_list = [0] * 8

    free_num = 0
    for rate in rates:
        if rate >= 3200:
            free_num += 1
        else:
            color_list[get_index(rate)] += 1

    color_kind = len(list(filter(lambda x: x > 0, color_list)))
    if color_kind == 0:
        print(str(1) + " " + str(free_num))
    else:
        print(str(color_kind) + " " + str(color_kind + free_num))

Solution (Python):
N = int(raw_input())
a = map(int, raw_input().split())
c = [0] * 9
for r in a:
    if r <= 399:
        c[1] = c[1] + 1
    elif r <= 799:
        c[2] = c[2] + 1
    elif r <= 1199:
        c[3] = c[3] + 1
    elif r <= 1599:
        c[4] = c[4] + 1
    elif r <= 1999:
        c[5] = c[5] + 1
    elif r <= 2399:
        c[6] = c[6] + 1
    elif r <= 2799:
        c[7] = c[7] + 1
    elif r <= 3199:
        c[8] = c[8] + 1
    elif 3200 <= r:
        c[0] = c[0] + 1
ans = 0
for i in c[1:]:
    if i != 0:
        ans = ans + 1
mn = ans
mx = ans + c[0]
if mn == 0:
    print 1, mx
else:
    print mn, mx

Solution (Python):
n=int(input())
aa=map(int,input().split())
aa=list(aa)
memo=[]
count=0
for a in aa:
    if a<400:memo.append(1)
    elif a<800:memo.append(2)
    elif a<1200:memo.append(3)
    elif a<1600:memo.append(4)
    elif a<2000:memo.append(5)
    elif a<2400:memo.append(6)
    elif a<2800:memo.append(7)
    elif a<3200:memo.append(8)
    else:count+=1

memo=set(memo)
min=len(memo)
if min==0:min=1
max=len(memo)+count

print(min,max)

Solution (Python):
input()
rates = sorted([int(x) for x in input().split()])
least = 0
for boundary in (399, 799, 1199, 1599, 1999, 2399, 2799, 3199):
    length = len(rates)
    while rates and (rates[0] <= boundary):
        rates.pop(0)
    least += length > len(rates)
print("{} {}".format((least == 0)+least, least+len(rates)))

Solution (Python):
input()
rates = sorted([int(x) for x in input().split()])
least = 0
for boundary in [399, 799, 1199, 1599, 1999, 2399, 2799, 3199]:
    least += 1 if rates and (rates[0] <= boundary) else 0
    rates = [rate for rate in rates if rate > boundary]
print("{} {}".format((least == 0)+least, least+len(rates)))

Solution (Python):
from sys import stdin
n = int(stdin.readline())
a  = map(int,stdin.readline().split())
ans = set()
co = 0
for i in a:
 if i < 3200:
  ans.add(i/400)
 else:
  co += 1
print  max(1,len(ans)),len(ans) + co