A slightly cleaner way of writing this would be `gets.to_i.strip`.