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" [Image] "oo" and "h" [Image] "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" $\rightarrow$ "kuuper" and "kuooper" $\rightarrow$ "kuuper".  "khun" and "kkkhoon". With the replacements described above you can make both words to be equal: "khun" $\rightarrow$ "khoon" and "kkkhoon" $\rightarrow$ "kkhoon" $\rightarrow$ "khoon". 

For a given list of words, find the minimal number of groups where the words in each group denote the same name.


-----Input-----

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.


-----Output-----

Print the minimal number of groups where the words in each group denote the same name.


-----Examples-----
Input
10
mihail
oolyana
kooooper
hoon
ulyana
koouper
mikhail
khun
kuooper
kkkhoon

Output
4

Input
9
hariton
hkariton
buoi
kkkhariton
boooi
bui
khariton
boui
boi

Output
5

Input
2
alex
alex

Output
1



-----Note-----

There are four groups of words in the first example. Words in each group denote same name:  "mihail", "mikhail"  "oolyana", "ulyana"  "kooooper", "koouper"  "hoon", "khun", "kkkhoon" 

There are five groups of words in the second example. Words in each group denote same name:  "hariton", "kkkhariton", "khariton"  "hkariton"  "buoi", "boooi", "boui"  "bui"  "boi" 

In the third example the words are equal, so they denote the same name.

Difficulty: competition

Starter code:

Solutions:
n = int(input())
s = set()


for a in range(n):
    name = input()

    name = name.replace('u', 'oo')

    while (name.count('kh') > 0):
        name = name.replace('kh', 'h')
    s.add(name)

print(len(s))


# Main maut ko takiya, aur kafan ko chaadar banakar audhta hoon!

n=int(input())

names={}

for i in range(n):
	s=input()
	
	while(s.find('kh')!=-1):
		s=s.replace('kh','h')
	
	while(s.find('u')!=-1):
		s=s.replace('u','oo')
	
	names[s]=1

print(len(names))





import sys

n = int(input())
s = set()
for line in sys.stdin:
    prev = line
    while True:
        word = prev.strip().replace("oo", "u").replace("kh", "h").replace("uo", "ou")
        if prev == word:
            break
        else:
            prev = word
    s.add(prev)

print(len(s))


import math
import re


def ria():
    return [int(i) for i in input().split()]


def ri():
    return int(input())


def rfa():
    return [float(i) for i in input().split()]


eps = 1e-9


def is_equal(a, b):
    return abs(a - b) <= eps


def distance(p0, p1):
    return math.sqrt((p0[0] - p1[0]) ** 2 + (p0[1] - p1[1]) ** 2)


n = ri()
mp = {}
ar=[]
for i in range(401,-1,-1):
    ar.append(('k'*i+'h'))

for i in range(n):
    st = input()
    st = st.replace('u', 'oo')

    for j in range(1,len(ar)):
        st=st.replace(ar[j-1],ar[j])

    mp[st] = 1
print(len(mp))


n = int(input())
dict_ch={}
for i in range(n):
    ch = input()
    if 'u' in ch:
        ch = ch.replace('u','oo')
    while 'kh' in ch:
        ch = ch.replace('kh','h')
    if ch not in dict_ch:
        dict_ch.update({ch:1})
print(len(dict_ch))

n = int(input())

s = set()

for i in range(n):
    cur = input()
    ref = ''
    for c in cur:
        if c == 'u':
            ref = ref + 'oo'
        else:
            ref = ref + c
    while True == True:
        check = True
        tmp = ''
        for c in range(0, len(ref)):
            if c != len(ref) - 1 and ref[c] == 'k' and ref[c + 1] == 'h':
                check = False
            else:
                tmp = tmp + ref[c]
        ref = tmp
        if check == True:
            break
    s.add(ref)
print(len(s))

n = int(input())
s = list()
for i in range(0, n):
    st = input()
    s.append(st)

for i in range(0, len(s)):
    st = s[i]
    while 'u' in st:
        st = st.replace("u", "oo")
    while "kh" in st:
        st = st.replace("kh", "h")
    s[i] = st

wds = set(s)
print(len(wds))



import sys

"""
sys.stdin = open('input.txt', 'r') 
sys.stdout = open('output.txt', 'w')
"""

n = int(input())

names = []

for _ in range(n):
	names.append(input())

other = []

for name in names:

	while 'u' in name:
		name = name.replace('u', 'oo')

	while 'kh' in name:
		name = name.replace('kh', 'h')

	other.append(name)


print(len(set(other)))

n = int(input())
words = [input() for _ in range(n)]
s = set()
for w in words:
    while 'kh' in w or 'u' in w:
        if 'kh' in w:
            for i in range(len(w) - 1):
                if 'kh' == w[i:i+2]:
                    w = w[:i] + 'h' + w[i+2:]
        else:
            for i in range(len(w)):
                if 'u' == w[i:i+1]:
                    w = w[:i] + 'oo' + w[i+1:]
    
    s.add(w)
print(len(s))


def amb1(s):
    l=list(s)
    s1=s
    l1=list(s1)
    while "kh" in s1:
        l1=list(s1)
        for i in range(len(l1)-1):
            if l1[i]=='k' and l1[i+1]=='h':
                l1=l1[:i]+l1[i+1:]
                s1=''.join(l1)
                break
    return ''.join(l1)
def amb2(s):
    l=list(s)
    s1=s
    l1=list(s1)
    while "u" in s1:
        l1=list(s1)
        for i in range(len(l1)):
            if l1[i]=='u':
                l1=l1[0:i]+['o','o']+l1[i+1:]
                s1=''.join(l1)
                #print(s1)
                break
    return ''.join(l1)
n=int(input())
l=[]
for i in range(n):
    s=str(input())
    while "kh" in s or "u" in s:
        if "kh" in s:
            s=amb1(s)
        if "u" in s:
            s=amb2(s)
    l.append(s)
ll=set(l)
print(len(ll))

n = int(input())

g = set()

for _ in range(n):
    s = input()
    while (True):
        new_s = s.replace('oo', 'u').replace('kh', 'h').replace('ou', 'uo')
        if new_s == s:
            break
        s = new_s

    if s not in g:
        g.add(s)
        
print(len(g))


n = int(input())
st = set()
for i in range(n):
    s = input()
    s = s.replace("u", "oo")
    for j in range(30, 0, -1):
        t = str('k'*j+'h')
        s = s.replace(t, 'h')
    st.add(s)
print(len(st))


n = input()

#print(n)

names = set()

for i in range(0, int(n)):
    s = input()

    while "kh" in s:
        s = s.replace("kh", "h")

    while "u" in s:
        s = s.replace("u", "oo")

    #print("->", s)
    #print(i)
    names.add(s)

print(len(names))


n = int(input())
names = []
for i in range(n):
    prvs_name = input()
    new_name = ''
    while prvs_name != new_name:
        new_name = prvs_name
        prvs_name = prvs_name.replace('oo', 'u')
        prvs_name = prvs_name.replace('kh', 'h')
        prvs_name = prvs_name.replace('ou', 'uo')
    if new_name not in names:
        names.append(new_name)
print(len(names))

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
	if ks:
		tp.append('k'*ks)
	s = "".join(tp)
	if s not in list(names.keys()):
		names[s] = 1
print(len(names))


c=[]
n=int(input())
for uygf in range(n):
    s=list(input())
    l=len(s)
    i=0
    p=[]
    d=['u','o','k','h']
    while(i<l):
        if(s[i] not in d):
            p.append(s[i])
            i+=1
        elif(s[i]=='o'):
            if(i+1<l and s[i+1]=='o'):
                p.append('u')
                i+=2
            elif(i+1<l and s[i+1]=='u'):
                p.append('u')
                s[i+1]='o'
                i+=1
            else:
                p.append('o')
                i+=1
        elif(s[i]=='k'):
            y=i+1
            while(y<l and s[y]=='k'):
                y+=1
            if(y!=l):
                if(s[y]=='h'):

                    p.append('h')
                    i=y+1
                else:
                    for pp in range(i,y):
                        p.append('k')
                    i=y
            else:
                for pp in range(i,y):
                    p.append('k')
                i=y
        else:
            p.append(s[i])
            i+=1

    c.append(p)
d=[]
for i in range(n):
    if(i in d):
        continue
    for j in range(i+1,n):
        if(c[i]==c[j]):
            d.append(j)
print(n-len(d))




import re
n = int(input())

names = set()

for i in range(n):
  word = input()
  word = re.sub("k*h", "%", word)
  word = word.replace("u", "oo")
  names.add(word)
  
print(len(names))

n = int(input())
d = {}
for _ in range(n):
	s = input()
	while (True):
		if s.find("kh") != -1:
			s = s.replace("kh", "h")
		elif s.find("u") != -1:
			s = s.replace("u", "oo")
		else:
			break
	d[s] = d.get(s,0) + 1
print(len(d))


n=int(input())
l=[]
for i in range(n):
    l.append(list(input().strip()))
ans=1
for i in range(n):
    j=len(l[i])-1
    if (len(l[i])==1):
        if (l[i][0]=='u'):
            l[i]=['o','o']
        else:
            continue
    while (j>0):
        if (l[i][j]=='h' and l[i][j-1]=='k'):
            l[i][j-1:j+1]=['h']
        j-=1
    j=0
    while (True):
        try:
            if (l[i][j]=='u'):
                l[i][j:j+1]=['o','o']
                j+=1
        except:
            break
        j+=1
l.sort()
for i in range(n-1):
    if (l[i]!=l[i+1]):
        ans+=1
print (ans)

import re

t = int(input())
dd = {}
for i in range(0, t):
    s = input()
    s = re.sub(r'[k]+h', 'h', s.rstrip())
    s = re.sub(r'u', 'oo', s.rstrip())
    dd[s] = 1

print(len(dd))


mapp={}
for _ in range(int(input())):
    data = input()
    new = [] 
    data=data.replace('u','oo')
    i=len(data)-1
    while i>=0:
        new.append(data[i])
        if data[i]=='h':
            i-=1
            while data[i]=='k':
                i-=1
        else:
            i-=1
    new=new[::-1]
    temp=''.join(new)
    if temp in mapp:
        mapp[temp]+=1
    else:
        mapp[temp]=1
print(len(mapp))


m = int(input())
st = list()
for i in range (0, m):
	s = input()
	st.append(s)

for i in range (0, len(st)):
	s=st[i]
	while 'u' in s:
		s = s.replace("u","oo")
	while "kh" in s:
		s = s.replace("kh","h")
	st[i] = s
		
wds = set(st)

print (len(wds))

n=int(input())
arr=[]
count=0
for i in range(n):
    x=input()
    while "kh" in x:
        x=x.replace("kh","h")
    while "u" in x:
        x=x.replace("u","oo")
    if x not in arr:
        count+=1
        arr.append(x)

print(count)

def check(result, s, i):
    while True:
        if s == result[i]:
            return True
        else:
            if s.count('h') > 0 and result[i].count('kh') > 0 and len(s) < len(result[i]):
                s.replace('h', 'kh')
            elif s.count('kh') > 0 and result[i].count('h') > 0 and len(s) > len(result[i]):
                result[i].replace('h', 'kh')
            else:
                return False


n = int(input(''))

s = list()

for _ in range(n):
    temp = input('').replace('u', 'oo')
    while temp.count('kh') > 0:
        temp = temp.replace('kh', 'h')
    s.append(temp)

result = list()

for temp in s:
    flag = False
    for i in result:
        if temp == i:
            flag = True
            break
    if not flag:
        result.append(temp)

print(len(result))

n=int(input())
e=set()
for i in range(n):
    s=input()
    while 1:
        s1=s
        s=s.replace('u','oo').replace('kh','h')
        if s==s1:
            break
    e.add(s)

print(len(e))