#K66012. Sum of Absolute Integers

    ID: 32326 Type: Default 1000ms 256MiB

Sum of Absolute Integers

Sum of Absolute Integers

Given a list of integers, your task is to compute the sum of the absolute values of the integers. In other words, for a list of integers a1, a2, ..., an, you should compute:

\( S = \sum_{i=1}^{n} |a_i| \)

Be sure to read the input from standard input and write the result to standard output.

inputFormat

The input consists of two lines:

  • The first line contains an integer n representing the number of elements.
  • The second line contains n space-separated integers.

outputFormat

Output a single integer which is the sum of the absolute values of the given integers.

## sample
5
1 -2 3 -4 5
15

</p>