I get the output 13, 13, 45 for the input suggested in the exercise. What am I doing wrong? I feel it's from the fileinputstream but I can't put my finger on it. Please advise. This is the current form, I don't know why it isn't updated.
public class Solution {
    public static void main(String[] args) throws IOException {
        //write your code here
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        FileInputStream input = new FileInputStream(reader.readLine());
        ArrayList<Integer> nrs = new ArrayList<>();
        int i = 0;
        while ((i = input.read()) != -1) {
            if (input.read() % 2 == 0)
            nrs.add(input.read());
        }
            Collections.sort(nrs);
            for (Integer f : nrs) System.out.println(f);

        reader.close();
        input.close();
    }
}