Why are you parseInting the input for the integer.

Why not just use

in.nextInt() and avoid the parse int?

I'm wondering if it's somehow taking in an empty line as input as storing that...