import scala.io.StdIn

object Main {
  def main(args: Array[String]){
    val n = StdIn.readInt()
    var res = -1
    for(i <- 0 to n - 1){
      res = List(res,StdIn.readInt()).max
    }
    println(res)
  }
}