import java.io.*;

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

        if (a > 0) {
            do {
                int c = Integer.parseInt(reader.readLine());
                sum = Math.max(c, sum);
                ++b;
            } while (b < a);

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