package main

import (
  "fmt"
)

func main(){
  
  var N int
  var A [200000] int
  var max_num int
  
  fmt.Scan(&N)
  for i := 0; i < N; i++ {
    fmt.Scan(&A[i])
    if (A[i] > max_num){
      max_num = A[i]
    }
  }
  fmt.Println(max_num)
}