Parse the input to a number.