public class Solution {
public static void main(String[] args) throws Exception {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int maximum=0;
//write your code here
ArrayList<Integer> data=new ArrayList<>();
int i;int n=0;
n=Integer.parseInt(reader.readLine());
data.add(n);
for (i=1;i<n;i++) {
data.add(Integer.parseInt(reader.readLine()));
}
for (i=0;i<n;i++){
int x=data.get(i);
if (x>maximum){
maximum=x;
}
}
System.out.println(maximum);
}
}

package com.codegym.task.task05.task0532;
import java.io.*;
import java.util.ArrayList;
/*
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;
//write your code here
ArrayList<Integer> data=new ArrayList<>();
int i;int n=0;
n=Integer.parseInt(reader.readLine());
data.add(n);
for (i=1;i<n;i++) {
data.add(Integer.parseInt(reader.readLine()));
}
for (i=0;i<n;i++){
int x=data.get(i);
if (x>maximum){
maximum=x;
}
}
System.out.println(maximum);
}
}