Function for getting integer input