#K36757. Product of Word Lengths

    ID: 25825 Type: Default 1000ms 256MiB

Product of Word Lengths

Product of Word Lengths

Given a list of words (which may include digits), compute the product of the lengths of all words that consist solely of alphabetic characters. If a word contains any non-letter character (e.g. digits), it should be ignored. Note that the product of an empty list is defined as 1. Mathematically, if there are k valid words with lengths \(|word_i|\), then the result is \(P = \prod_{i=1}^{k} |word_i|\). If there is no valid word, the product is 1.

The input is given in two lines: the first line contains an integer n representing the number of words, and the second line contains n words separated by spaces.

inputFormat

The first line contains an integer n representing the number of words. The second line contains n tokens separated by spaces. Each token can be an alphabetical word or a digit (or a mix, though only purely alphabetical words are considered).

outputFormat

Output a single integer: the product of lengths of all words that consist only of letters. If there are no valid words, output 1.

## sample
5
apple 5 banana orange 8
180