program name
    implicit none
    integer(4):: n
    integer(4),allocatable:: a(:)
    integer(4):: over
    integer(4):: i,j
    logical:: iro(8)

    read*, n
    allocate(a(n))
    read*, a(:)
    iro(:) = .false.
    over = 0

    do i=1,n
        do j=0,4800
            if (j*400 <= a(i) .and. a(i) < (j+1)*400) then
                if (j < 8) then
                    iro(j+1) = .true.
                else
                    over=over+1
                end if
            end if
        end do
    end do


    print*, min(tsum(iro),1)
    print*, tsum(iro)+over


contains
    function tsum(larr) result(ret)
        logical:: larr(:)
        integer(4):: ret
        integer(4):: i
        ret=0
        do i=1,size(larr)
            if (larr(i)) ret=ret+1
        end do
    end function
end program name