Bug

Hi my codes works fine.When i key in ,for example, asdf 546,(f and 5 is separated by space), the programe rightly take it as invalid input ,however it takes asdf and 546 as separate type and return two "Invalid input".See below.
I hav no clue why it does that oher than it being something with the nextLine.How can i get it to see asdf 546 is one input value?output
How many integers shall we compare? (Enter a positive integer):
3
Enter value 1:55
Enter value 2:asdf 546
Invalid input!
Enter value 2:Invalid input!
Enter value 2:
23
Enter value 3:-13
The smallest number entered was: -13