package com.codegym.task.task05.task0532;
import java.io.*;
import static java.lang.Integer.MIN_VALUE;
/*
Task about algorithms
*/
public class Solution {
public static void main(String[] args) throws Exception {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int maximum = Integer.MIN_VALUE;
int num = Integer.parseInt(reader.readLine());
for (int i = 0; i < num; i++) {
int nextInt = Integer.parseInt(reader.readLine());
if (nextInt > maximum) {
maximum = nextInt;
} else {
if (num > maximum)
maximum = num;
}
}if(maximum != MIN_VALUE){
System.out.println(maximum);
}
}
}