import java.io.*;

/*
Task about algorithms

*/

public class Solution {
    public static void main(String[] args) throws Exception {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        int maximum =0 ;
        int N = Integer.parseInt(reader.readLine());

        if (N>0) {
            for (int a = N; a > 0; a--) {
                int b = Integer.parseInt(reader.readLine());
                if (b > maximum) {
                    maximum = b;
                }


        //write your code here

        System.out.println(maximum);
    }
}
}
}