All problems

Bars and a Line on the Same Axes

mediumPythonMatplotlibCombined Charts

Kestrel Freight sets one delivery target per depot per month, and the monthly review shows each month's actual figure against the target it was given. The targets move between months, so a single flat line across the chart would be wrong — every month brings its own. The review opens with one number: how many months came in under their own target.

Task: Print how many months fell short of their target.

Input

The first line holds one integer n, the number of months. Each of the next n lines holds a month name, that month's actual figure and that month's target, separated by single spaces. Month names contain no spaces.

Output

One line holding a single whole number: the count of months whose actual figure is below their own target. A month that lands exactly on its target has not fallen short. Print 0 when every month delivered.

Example:

Input:
3
Jan 100 90
Feb 80 90
Mar 95 90

Output:
1

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…