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());
int c =0,a =0;
while(N>0 &&c != N){
a = Integer.parseInt(reader.readLine());
c++;
if(a>=maximum)
maximum = a;
}
System.out.println(maximum);
}
}
package com.codegym.task.task05.task0532;
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());
int c =0,a =0;
while(N>0 &&c != N){
a = Integer.parseInt(reader.readLine());
c++;
if(a>=maximum)
maximum = a;
}
System.out.println(maximum);
}
}