#K47767. Highest Sum of Three Numbers

    ID: 28272 Type: Default 1000ms 256MiB

Highest Sum of Three Numbers

Highest Sum of Three Numbers

You are given a list of five integers. Your task is to compute the maximum possible sum of any three distinct numbers from the list. In mathematical terms, if the integers are \(a_1, a_2, a_3, a_4, a_5\), you should choose indices \(i, j, k\) (all distinct) such that the sum \(S = a_i + a_j + a_k\) is maximized.

The input is provided as a single line with five space-separated integers, and the output should be a single integer representing the highest sum of any three numbers from the given list.

inputFormat

The input is given via standard input (stdin) as a single line containing five space-separated integers.

outputFormat

The output is a single integer printed to standard output (stdout), which is the highest possible sum of any three of the provided integers.

## sample
1 2 3 4 5
12