program main
implicit none
integer :: i, j, k
integer :: n, b(8)
integer , allocatable :: a(:)

read(*,*) n
allocate( a(n) )
read(*,*) a
a = a/400
b = 0
k = 0
do i = 1, n
   do j = 0, 7
      if( a(i) == j ) then
         b( j+1 ) = 1
      end if
   end do
   if( a(i) .ge. 8 ) then
      k = k + 1
   end if
end do
write(*,'(i0)') sum(b), min(8,sum(b)+k)
end program main
