Having a problem with the last condition I can't seem to figure out the problem. Please help!
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.MIN_VALUE;
int count = 0;
while (n > count){
count ++;
int n2 = Integer.parseInt(reader.readLine());
if (n2>maximum){
maximum = n2;
}
}
System.out.println(maximum);
}
}