This page is still under construction.

Parts of this page are still being built. What you see may change.

Counting Monuments

Time limit2sMemory limit512 MB

Summary
Read n lines, each with a date and a monument name, and output the number of distinct monument names.
Level

Easy2 of 10

Topics
Hash map, String, Implementation
Solved
No attempts yet

Problem

Alice loves visiting Paris. Every time she is in the city, she tries to see as many monuments as she can, and every day of her visit she notes down in her travel notebook which monument she saw that day. After many years and many trips to Paris, Alice wonders how many different monuments she has seen across all her visits. She shows you her travel notebook and asks for your help in computing this number.

Input

The input consists of n lines. Each line contains, first, a date (in the format YYYY-MM-DD), then a space, then the name of a monument. Names of monuments are character strings of arbitrary length containing arbitrary printable characters except for the newline character.

Output

The output consists of a single line whose content is an integer, the number m of distinct monuments in the input.

Constraints

  • 1 ≤ n ≤ 1 000 000

Examples1

  1. Example 1

    Input
    2016-12-30 Tour Eiffel
    2016-12-31 Tour Saint-Jacques
    2016-12-31 Centre Georges Pompidou
    2018-01-15 Tour Eiffel
    2018-01-15 Invalides
    2018-01-15 Arc de Triomphe
    2018-01-16 Tour Saint-Jacques
    2018-01-16 Panthéon
    2018-01-17 Sacré Cœur
    
    Expected output
    7