All problems

Stacked Overlaid Histograms With multiple='stack'

hardPythonSeabornmultiple

Calder Health charts waits for two booking channels together. Drawn over each other the two colours obscure one another, so each bucket is drawn as one bar with the channels sitting on top of each other — the full bar height is then the bucket's combined total. The board's line is that combined total for the first bucket, ten minutes wide starting at zero.

Task: Print the combined count in the first bucket.

Input

The first line holds one integer n, the number of patients. Each of the next n lines holds a channel name and that patient's wait, separated by a single space. Channel names contain no spaces, and a wait may come out negative when a clock was set wrong.

Output

One line holding a single whole number: how many waits across ALL channels are at least 0 and less than 10. A wait of exactly 10 belongs to the next bucket. Print 0 when the bucket is empty.

A quiet hour can leave every wait sitting within a few minutes of every other. The chart is one bucket wide in that case, which is still a chart and still an answer: report the count in the same format, with no special message and no error.

Example:

Input:
4
A 5
B 8
A 15
B 3

Output:
3

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…