Handle number input