TLE '16 Contest 3 P1 - Hapax Legomenon

View as PDF

Submit solution

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

Problem type
Allowed languages
Ada, Assembly, Awk, Brain****, C, C#, C++, COBOL, CommonLisp, D, Dart, F#, Forth, Fortran, Go, Groovy, Haskell, Intercal, Java, JS, Kotlin, Lisp, Lua, Nim, ObjC, OCaml, Octave, Pascal, Perl, PHP, Pike, Prolog, Python, Racket, Ruby, Rust, Scala, Scheme, Sed, Swift, TCL, Text, Turing, VB, Zig
A vivid illustration of a problem that nathanl3's artificial network is trying to analyze.

nathanl3 has written a 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 \leq N \leq 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


Sample Output



There are no comments at the moment.