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