#K42587. Minimum Shipping Cost

    ID: 27120 Type: Default 1000ms 256MiB

Minimum Shipping Cost

Minimum Shipping Cost

You are given an integer (M) representing the number of days and a list of (M) integers representing the daily demand. The task is to calculate the minimum shipping cost required to fulfill all the demands. The shipping cost for each day is equal to the number of items demanded on that day. Thus, the total minimum shipping cost can be computed using the formula: (\text{Total Cost} = \sum_{i=1}^{M} \text{demand}_i).

In other words, you need to sum up all the provided daily demands to determine the total cost. Please note, the input will be provided via standard input (stdin) and the output should be printed to standard output (stdout).

inputFormat

The input is read from stdin and consists of two lines:
1. The first line contains a single integer (M), the number of days.
2. The second line contains (M) space-separated integers, each representing the demand for a day.

outputFormat

The output is a single integer printed to stdout representing the minimum shipping cost (i.e., the sum of the daily demands).## sample

5
1 2 3 4 5
15