sem2hw5task1: Improved clearing of input stream after getting numbers.