Yiit created a playlist full of songs that Dero loves. But Dero has a special rule for their playlists and this playlist does not obey that rule. So now Dero needs to rearrange the playlist and split the list into several different ones.
Dero creates their playlists with respect to the letters of the songs. For different songs to be in the same playlist, they need to have at least one common letter. How many new playlists should Dero create to split the playlist that Yiit made for him, in order not to break the rule?
For the Songs Dero Loves: https://open.spotify.com/playlist/4SHl6R9NFhhx68Y8gYmO0v?si=aFCzGtjIT3SdTcU86JkczQ
- In the end, all of the songs in a single playlist of Dero's should include a common letter.
- All of the song names will be comprised of only lower case letters.
Input
First line consists of the number of songs in the playlist, integer \(\mathbf{N}\).
Next \(\mathbf{N}\) lines include the name \(\mathbf{A_i}\) of the \(\mathbf{i}\)th song.
Batch #1:
- \(1 \leq \mathbf{N} \leq 100\)
- \(1 \leq \mathbf{len(A_i)} \leq 10\)
Batch #2:
- \(1 \leq \mathbf{N} \leq 10^{5}\)
- \(1 \leq \mathbf{len(A_i)} \leq 10\)
Output
The minimum number of playlists that Dero needs to split Yiit's playlist.
Examples
Input:
3
aa
bb
cc
Output:
3
Input:
3
ab
bc
cd
Output:
2