Handle invalid input.

* Check if the input String only contains integers.
* Text throws if the input number is out of range.