All problems

Long Labels Need a Horizontal Bar Chart

easyPythonMatplotlibBar Chart

Harbourview Consulting's budget slide charts one bar per department. Department names are long — Engineering, Marketing, Facilities Management — and standing them under upright bars either squashes them into unreadable stubs or tips them onto their side at an angle nobody enjoys reading. Laying the bars along the page instead gives each name a full line of its own. The slide also carries one figure in its footer, and that footer figure is what is checked here, not the picture: the budget for the whole organisation.

Task: Print the total budget across all departments.

Input

The first line holds an integer n, the number of departments. Each of the next n lines holds a department name and its budget, separated by a single space. A name contains no spaces.

Output

One line holding the sum of all the departments' budgets, as a plain integer.

Example:

Input:
2
Engineering 500
Marketing 200

Output:
700

Sign in to solve this problem

Reading problems is free for everyone — solving them (Run, Submit, and tracking what you've solved) needs an account.

Sign in

Discussion

Sign in to join the discussion — reading is open to everyone.

Loading comments…