not able to complete the last task
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 n = Integer.parseInt(reader.readLine());
int maximum = Integer.parseInt(reader.readLine());
for ( int i = 0; i<=n-1 ; i ++ ) {
int x = Integer.parseInt(reader.readLine());
if ( x >= maximum )
maximum = x;
else
maximum = maximum;
}
//write your code here
System.out.println(maximum);
}
}