There are some ambiguities when one writes Berland names with the letters of the Latin alphabet.

For example, the Berland sound u can be written in the Latin alphabet as "u", and can be written as "oo". For this reason, two words "ulyana" and "oolyana" denote the same name.

The second ambiguity is about the Berland sound h: one can use both "h" and "kh" to write it. For example, the words "mihail" and "mikhail" denote the same name.

There are *n* users registered on the Polycarp's website. Each of them indicated a name represented by the Latin letters. How many distinct names are there among them, if two ambiguities described above are taken into account?

Formally, we assume that two words denote the same name, if using the replacements "u" <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/8774ca35b6e628888a4670e4539d47857e5e5841.png" style="max-width: 100.0%;max-height: 100.0%;"/> "oo" and "h" <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/8774ca35b6e628888a4670e4539d47857e5e5841.png" style="max-width: 100.0%;max-height: 100.0%;"/> "kh", you can make the words equal. One can make replacements in both directions, in any of the two words an arbitrary number of times. A letter that resulted from the previous replacement can participate in the next replacements.

For example, the following pairs of words denote the same name:
 -  "koouper" and "kuooper". Making the replacements described above, you can make both words to be equal: "koouper" <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/70a0795f45d32287dba0eb83fc4a3f470c6e5537.png" style="max-width: 100.0%;max-height: 100.0%;"/> "kuuper" and "kuooper" <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/70a0795f45d32287dba0eb83fc4a3f470c6e5537.png" style="max-width: 100.0%;max-height: 100.0%;"/> "kuuper". -  "khun" and "kkkhoon". With the replacements described above you can make both words to be equal: "khun" <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/70a0795f45d32287dba0eb83fc4a3f470c6e5537.png" style="max-width: 100.0%;max-height: 100.0%;"/> "khoon" and "kkkhoon" <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/70a0795f45d32287dba0eb83fc4a3f470c6e5537.png" style="max-width: 100.0%;max-height: 100.0%;"/> "kkhoon" <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/70a0795f45d32287dba0eb83fc4a3f470c6e5537.png" style="max-width: 100.0%;max-height: 100.0%;"/> "khoon". 
For a given list of words, find the minimal number of groups where the words in each group denote the same name.
The first line contains integer number *n* (2 ≤ *n* ≤ 400) — number of the words in the list.

The following *n* lines contain words, one word per line. Each word consists of only lowercase Latin letters. The length of each word is between 1 and 20 letters inclusive.
There are four groups of words in the first example. Words in each group denote same name:
 1.  "mihail", "mikhail" 1.  "oolyana", "ulyana" 1.  "kooooper", "koouper" 1.  "hoon", "khun", "kkkhoon" 
There are five groups of words in the second example. Words in each group denote same name:
 1.  "hariton", "kkkhariton", "khariton" 1.  "hkariton" 1.  "buoi", "boooi", "boui" 1.  "bui" 1.  "boi" 
In the third example the words are equal, so they denote the same name.
10
mihail
oolyana
kooooper
hoon
ulyana
koouper
mikhail
khun
kuooper
kkkhoon
4
9
hariton
hkariton
buoi
kkkhariton
boooi
bui
khariton
boui
boi
5
2
alex
alex
1
40
uok
kuu
ku
o
kku
uh
u
u
hh
k
kh
h
h
ou
okh
ukk
ou
uhk
uo
uko
u
uu
h
h
hk
uhu
uoh
ooo
k
h
uk
k
kku
h
ku
ok
k
kuu
ou
hh
21
40
oooo
hu
o
hoh
khk
uuh
hu
ou
uuoh
o
kouk
uouo
u
ok
uu
uuuo
hoh
uu
kuu
h
u
kkoh
khh
uoh
ouuk
kuo
k
u
uku
h
u
k
huho
ku
h
oo
uh
k
uo
ou
25
100
uh
u
ou
hk
okh
uou
k
o
uhh
k
oku
k
ou
huh
koo
uo
kk
kok
hhu
uu
oou
k
k
oh
hk
k
u
o
uo
o
o
o
hoh
kuo
huh
khu
uu
k
oku
k
h
uu
uo
huo
oo
hu
ukk
ok
o
oh
uo
kko
ok
ouh
koh
hhu
ku
ko
hho
kho
kho
khk
ho
hk
uko
ukh
h
kh
kk
uku
kkk
o
uo
o
ouh
ou
uhk
ou
k
h
kko
uko
o
u
ho
u
ooo
uo
o
ko
oh
kh
uk
ohk
oko
uko
h
h
oo
o
36
101
ukuu
h
ouuo
o
kkuo
ko
u
h
hku
h
h
huo
uhoh
kuu
hu
hkko
uhuk
koho
h
hukk
oohu
kk
kko
ou
oou
h
uuu
uh
khuk
okoo
ouou
uo
kk
oo
huok
o
u
hok
hu
hhuu
kuu
ooho
oku
huoh
hhkh
uuuh
ouo
hou
hhu
h
o
okou
uo
h
ukk
u
hook
h
oouk
okuo
kuuu
k
uuk
u
ukk
kk
u
uhk
h
k
okuu
uoho
khuk
hukk
hoo
ouko
u
uu
u
h
huo
h
ukk
hk
k
uoh
hk
ko
ou
ho
u
hhhk
kuo
huo
hkh
ku
hok
ho
kok
hk
ouuh
50
2
kkkhkkh
hh
1
2
kkhookkhoo
huhu
1
n = int(input())
names = dict()
for i in range(n):
	s = input()
	tp = []
	ks = 0 
	l = len(s)
	tp = []
	flag = 0
	for i in range(l):
		if s[i]=='k' :
			ks+=1
			flag = 1
		else:
			if s[i]=='h' and flag==1:
				tp.append('h')
			else:
				tp.append('k'*ks)
				if s[i]=='u':
					tp.append('oo')
				else:
					tp.append(s[i])
			ks = 0 
			flag = 0
	s = "".join(tp)
	if s not in names.keys():
		names[s] = 1
print(len(names))
