Maximum and sum of numbers