All problems

Comparing Two Series Side by Side

hardPythonMatplotlibGrouped Bars

Alderwood Supply's board pack compares revenue this year against last year, one pair of bars per category so the reader can see both years at the same place on the page rather than flicking between two charts. The starter code already draws the pairs. What the board asks for in words, and what is checked here, is the headline underneath: how many categories actually grew. A category that came in exactly level with last year did not grow — the board treats flat as flat, not as a small win.

Task: Print how many categories grew year on year.

Input

The first line holds an integer n, the number of categories. Each of the next n lines holds a category name, last year's revenue and this year's revenue, separated by single spaces. A name contains no spaces.

Output

One line holding the count of categories whose revenue this year is higher than last year's, as a plain integer.

Example:

Input:
3
Q1 100 120
Q2 90 90
Q3 80 70

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…