package com.codegym.task.task05.task0532;

import java.io.*;
import java.util.*;
import java.util.Arrays;

/*
Task about algorithms

*/

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

        for(int i = 0; i < n; i++){
            String input = reader.readLine();
            int number   = Integer.parseInt(input);
            numbers[i]   = number;

        }

        if(n > 0){
           Arrays.sort(numbers);
           int maximum = numbers[numbers.length-1];
           System.out.println(maximum);
        }
    }
}