SC2 Multitasking

View as PDF

Submit solution

Points: 3
Time limit: 2.0s
Memory limit: 64M

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

Last night, Henning was playing Starcraft 2 while simultaneously attempting to finish his English essay. Because he is such a grandmaster at the game, he can in fact do such a thing - but he only has a single keyboard. Henning has to reserve two thirds of his keyboard to play Starcraft 2; given a list of N words in his English essay (1 \le N \le 100\,000) each one of them less than or equal to 10 letters long, how many of them can be typed exclusively using one row of his QWERTY keyboard?

Input Specification

On the first line, the number N. On the next N lines, a single string of lowercase letters.

Output Specification

A single line containing the number of strings that can be typed exclusively using a single row of the QWERTY keyboard.

Sample Input


Sample Output



There are no comments at the moment.