#K15451. Maximum Array Sum

    ID: 24359 Type: Default 1000ms 256MiB

Maximum Array Sum

Maximum Array Sum

You are given an array of n integers. Your task is to compute the maximum possible sum of the array elements. In this problem the maximum sum is simply the sum of all the numbers in the array.

The problem can be mathematically described as follows:

Given an array \(A = [a_1, a_2, \ldots, a_n]\), compute the sum \(S = \sum_{i=1}^{n} a_i\).

For example, if the input array is [1, 2, 3], then the maximum possible sum is 6.

inputFormat

The first line contains an integer n representing the number of elements in the array.

The second line contains n space-separated integers representing the elements of the array.

outputFormat

Output a single integer, which is the sum of all the elements in the array.

## sample
3
1 2 3
6