All problems

Coloring Bars by a Threshold

mediumPythonMatplotlibConditional Styling

Harbourview Consulting's monthly scorecard shows one bar per team against a target, and colours the bars so the answer is visible from the back of the room: green for a team that reached the target, red for one that fell short. Reaching the target exactly counts as reaching it — a team level with the target is green. A dashed line is ruled across at the target as well. The line printed under the chart, and the thing checked here, is how many teams came out red.

Task: Print how many teams fell short of the target.

Input

The first line holds the target. The second line holds an integer n, the number of teams. Each of the next n lines holds a team name and its score, separated by a single space. A name contains no spaces.

Output

One line holding the count of teams scoring below the target, as a plain integer.

Example:

Input:
50
3
A 60
B 40
C 45

Output:
2

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…