Sort parameters and cast to int