All problems

Removing Chart Borders With despine

easyPythonSeaborndespine

A Marlow & Finch client dislikes charts that look boxed in, so their bar charts have the top and right border lines stripped off, leaving only the two edges that carry the labels. The bars themselves are one per named category. Before the figure is placed on the page, the layout script needs to know how many bars it will have to fit.

Task: Print how many different categories appear.

Input

The first line holds one integer n, the number of records, where 1 <= n <= 1000. Then come n lines, each holding a category name and a value separated by a single space. Category names contain no spaces, and a category may appear on more than one line.

Output

One line holding a whole number: how many distinct category names there are. A category appearing on five lines still gets one bar, and counts once.

Example:

Input:
3
A 10
B 20
C 15

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…