#K72767. Store Sale Optimization
Store Sale Optimization
Store Sale Optimization
During a store sale, you are presented with \(n\) items. Each item is identified by its name and has an associated price. Your task is to calculate the total sum of the prices of all the items in the store.
Input: The first line contains a single integer \(n\) representing the number of items. Each of the following \(n\) lines contains a string and an integer separated by a space - the name of the item and its price respectively.
Output: Output a single integer representing the sum of the prices of all \(n\) items.
Mathematically, if the price of the \(i\)-th item is \(p_i\), then you need to compute:
\[ Total = \sum_{i=1}^{n} p_i \]inputFormat
The first line contains an integer \(n\) (\(1 \le n \le 10^5\)), the number of items. Each of the following \(n\) lines contains an item description in the format:
name price
where name
is a string (without spaces) and price
is an integer.
outputFormat
Output a single integer representing the sum of the prices of all the \(n\) items. The result should be printed to standard output.
## sample5
A 10
B 40
C 30
D 50
E 20
150