P10867 [HackerEarth] ornaments of byteland
普及
题目描述

CodeswarBala found various ornaments in Btyeland. Each ornament is made up of various items, and each item is represented by a letter from 'a' to 'z'. An item can be present multiple times in a ornament . An item is called special item if it occurs at least once in each of the ornament.

Given the list of N ornaments with their compositions, display the number of special items that exist in those ornaments.

Input Format

The first line consists of an integer, N, the number of ornaments.
Each of the next NNlines contains a ornaments'composition. Each composition consists of lower-case letters as mentioned above.

Constraints
1≤N≤100
1≤ length of each composition ≤100

Output Format

Print the number of special items that are common in these ornaments. If there are none, print 0.

SAMPLE INPUT
3
abcdde
baccd
eeabg

SAMPLE OUTPUT
2

Explanation

Only "a" and "b" are the two kinds of special elements, since these are the only characters that occur in every ornaments's composition.

输入格式

见题面

输出格式

见题面

样例输入
3 abcdde baccd eeabg SAMPLE
样例输出
2