вроде все просто, но что-то пошло не так. помогите:)
package com.javarush.task.task05.task0532;
import java.io.*;
/*
Задача по алгоритмам
*/
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 i = Integer.parseInt(reader.readLine()); //напишите тут ваш код
if (N>0) {
i=0;
int maximum = Integer.MIN_VALUE;
while (i<=N) {
i++;
int f = Integer.parseInt(reader.readLine()); }
if (f>maximum){
maximum = f; }
System.out.println(maximum);
}
}
}