#K86142. One Row Keyboard Words

    ID: 36799 Type: Default 1000ms 256MiB

One Row Keyboard Words

One Row Keyboard Words

Given a collection of words, your task is to determine the number of words that can be typed using letters from only one row of a standard QWERTY keyboard. The rows on a standard QWERTY keyboard are as follows:

Row 1: QWERTYUIOP
Row 2: ASDFGHJKL
Row 3: ZXCVBNM

A word is considered valid if all its letters (case-insensitive) belong to one of these rows only.

Input Example: If the input is "5\nHello Alaska Dad Peace Quiz\n", then the output should be 2 because only "Alaska" and "Dad" satisfy the condition.

The solution should support any valid sequence of words and provide the count of words fulfilling the condition.

Note: All formulas or special notations should be formatted in \( \LaTeX \) style if needed.

inputFormat

The first line contains an integer \( n \) representing the number of words. The second line contains \( n \) space-separated words. All words consist only of alphabetic characters.

outputFormat

Print a single integer which is the count of words that can be typed using letters of only one row of a standard QWERTY keyboard.

## sample
5
Hello Alaska Dad Peace Quiz
2

</p>