TLE '16 Contest 3 P1 - Hapax Legomenon

View as PDF

Submit solution


Points: 3 (partial)
Time limit: 2.0s
Memory limit: 256M

Author:
Problem type
A vivid illustration of a problem that nathanl3's artificial network is trying to analyze.

nathanl3 has written an English language parser and downloaded a bunch of problem statements. His goal is to create an artificial network that guesses the difficulty of programming problems.

nathanl3's first problem is, "What is the best metric?"

He goes onto Wikipedia and finds an interesting term, hapax legomenon, which is defined as a word that appears once in the entire text. But his code crashes when counting the hapax legomena of one specific problem statement that consists of N words. Can you help nathanl3 by providing this number?

Input Specification

The first line contains the integer N (1 \le N \le 1000).

Each of the next N lines contains a word, which is a sequence of lowercase characters of the English alphabet. A word will not exceed 16 characters in length.

Output Specification

Output a single integer, signifying the number of hapax legomena (words that appear once).

Sample Input

8
they
are
very
very
very
slow
and
unresponsive

Sample Output

5

Comments

There are no comments at the moment.