max_input function

Helper function to get $max from 'input' list