All problems

Suppressing the Auto-Generated Legend

easyPythonSeabornLegend

Marlow & Finch colour each bar of a chart by its own category, which makes the charting library add a legend repeating the labels already written under the bars. On a narrow page that legend steals space and tells the reader nothing new, so it is switched off. The page layout still needs the number of bars.

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 several lines still gets one bar, and counts once.

Example:

Input:
3
A 10
B 20
C 30

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…