Time Limit : sec, Memory Limit : KB
English / Japanese  

Into the Wild

    In recent years, the country of Izua has been plagued by animals that come down from the mountains to the city. You have done a lot of research to try to bring the animals back to the mountains, and you have discovered the following.

  • Each animal has a unique name.
  • If you insert a letter anywhere in the name of one of the two animals, and it matches the name of the other animal, you can pair them up and send them back to the mountain.
  • Once an animal has returned to the mountain, it will not come down to the city again.

You have decided to calculate how many animals that have come down to the city can be sent back to the mountain in this way.

Given the names of the animals that have come down to the city, write a program to find the maximum number of pairs that can be sent back up the mountain in this way.

Input

The input is given in the following form.

$N$
$str_1$
$str_2$
:
$str_N$

The first line gives the number of animals $N$ ($2 \leq N \leq 100,000$). In the following $N$ lines, the string $str_i$ representing the name of the $i$-th animal is given. $str_i$ is a string of no more than 10 characters consisting of lowercase and uppercase letters. Also, the names of all animals are different ($str_i \ne str_j$ if $i \ne j$).

Output

Output the maximum number of pairs of animals that can be sent back to the mountain.  

Sample Input and Output

Sample Input 1

4
aedb
aeb
ebCd
cdE

Sample Output 1

1

Sample Input 2

4
bcD
bD
AbD
bc

Sample Output 2

2