BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); int maximum = MIN_VALUE; int n = Integer.parseInt(reader.readLine()); if (n>0) { for (int i = 0; i < n; i++) { int num = Integer.parseInt(reader.readLine()); if (num > maximum) { maximum = num; } } } if (maximum>0) System.out.println(maximum); else;