! maximum 
! Input: a positive integer n, followed by n integers a_1, ..., a_n 
! Output: the maximum of the n integers a_1, ..., a_n

program maximum
    implicit none
    integer :: n, i, a, max

    ! Read the number of integers from the standard input
    read *, n

    ! Read the first integer
    read *, max

    ! Read the remaining n-1 integers
    do i = 2, n
        read *, a
        if (a > max) then
            max = a
        end if
    end do

    ! Print the maximum
    write(*, '(I0)') max

end program maximum
