#K13466. Net Investment Calculation
Net Investment Calculation
Net Investment Calculation
Sarah is involved in several financial transactions, both deposits (positive values) and withdrawals (negative values). Given the number of transactions \(N\) and a list of transaction amounts, your task is to compute Sarah's net investment, i.e., the sum of all the transactions.
Constraints:
- \(1 \leq N \leq 100\)
- Each transaction is an integer between -10000 and 10000.
Input Format: The first line of input contains the integer \(N\). The second line contains \(N\) space-separated integers representing the transactions.
Output Format: A single integer, the net investment value, is printed to standard output (stdout).
For example, if the input is:
3 500 -200 300
Then the output should be:
600
inputFormat
The input is given via standard input (stdin) and consists of two lines.
- The first line contains an integer \(N\), the number of transactions.
- The second line contains \(N\) space-separated integers, where each integer represents a transaction amount.
outputFormat
Output a single integer representing Sarah's net investment, i.e., the sum of the transaction amounts. The output should be printed to standard output (stdout).
## sample3
500 -200 300
600