Count the characters

0

0 votes
Problem

Harry is playing a game with is friend. He is given a notebook which has names of their friends written in various lowercase letter from 'a' to 'z'. His task is to find a 'special-letters'. A letter is a 'special-letters' if it occurs at least once in each of their friends name.

Given the list of N names, display the number of special-letters that exist in names.

Input
The first line consists of N, the number of names.
Each of the next N lines contain names. Each name consists of lowercase letters of English alphabet.

Output
Print the number of special-letter that are common in these names. If there are none, print 0.

Constraints
1<= N <=100
Each name consists of only lowercase letters ('a'-'z').
1<=Length of each name<=100

Sample Input
3
abcdde
baccd
eeabcg
Sample Output
3
Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

Only "a", "b", "c" are the 3 kind of special-letters, since these are the only characters that occur in each of the name has.

Contributers:
Editor Image

?