```
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int maximum = 0;
int n = Integer.parseInt(reader.readLine());
int arr[] = new int [n];
for(int i = 0; i < n - 1; i += 1){
int number = Integer.parseInt(reader.readLine());
arr[i] = number;
}
arr[n - 1] = n;
Arrays.sort(arr);
maximum = arr[n - 1];
System.out.println(maximum);
```

package com.codegym.task.task05.task0532;
import java.io.*;
import java.util.*;
/*
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;
int n = Integer.parseInt(reader.readLine());
int arr[] = new int [n];
for(int i = 0; i < n - 1; i += 1){
int number = Integer.parseInt(reader.readLine());
arr[i] = number;
}
arr[n - 1] = n;
Arrays.sort(arr);
maximum = arr[n - 1];
System.out.print(maximum);
}
}

line 19can't parse negative integers withInteger.parseInt()I have triedInteger.valueOf()with no luck EDIT: Finally fixed it lol thanks again