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" <image> "kuuper" and "kuooper" <image> "kuuper". 
  * "khun" and "kkkhoon". With the replacements described above you can make both words to be equal: "khun" <image> "khoon" and "kkkhoon" <image> "kkhoon" <image> "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:

  1. "mihail", "mikhail" 
  2. "oolyana", "ulyana" 
  3. "kooooper", "koouper" 
  4. "hoon", "khun", "kkkhoon" 



There are five groups of words in the second example. Words in each group denote same name:

  1. "hariton", "kkkhariton", "khariton" 
  2. "hkariton" 
  3. "buoi", "boooi", "boui" 
  4. "bui" 
  5. "boi" 



In the third example the words are equal, so they denote the same name.
/* 
 * UMANG PANCHAL
 * DAIICT
 */
import java.util.*;
import java.io.*;
public class Main
{
 
	static ArrayList<Integer> adj[];
	static char color[];
	static boolean b[],visited[],possible;
	static int level[];
	static Map<Integer,HashSet<Integer>> s;
	static int totalnodes,colored;
	static int count[];
	static long sum[];
	static int nodes;
	static double ans=0;
	static long[] as=new long[10001];
	static long c1=0,c2=0;
	static int[] a,d,k;
	static int max=100000000;
	static long MOD = (long)1e9 + 7,sm=0,m=Long.MIN_VALUE;
	static boolean[] prime=new boolean[1000005];
	
	// --------------------My Code Starts Here----------------------
	
	public static void main(String[] args) throws IOException
	{
		in=new InputReader(System.in);
		w=new PrintWriter(System.out);
        int n=ni();
        HashSet<String> h=new HashSet<String>();
        while(n-->0)
        {
        	String s=in.nextLine();
        	String ans="";
        	int i=0;
        	char[] c=s.toCharArray();
        	while(i<c.length)
        	{
        		if(c[i]=='u')
        			{
        			//w.println("a");
        			ans+="oo";
        			i++;
        			}
        		else if(c[i]=='k')
        		{
        			//w.println("b");
        			int j=i;
        			String t="";
        			while(j<c.length && c[j]=='k')
        				{
        				t+=c[j];
        				j++;
        				}
        			if(j<c.length)
        			{
        				if(c[j]=='h')
        				{
        				  ans+='h';
        				  i=j+1;
        				}
        				else 
        				{
        					ans+=t;
        					i=j;
        				}
        			}
        			else
        			{
        				ans+=t;
        				i=j;
        			}
        		}
        		else
        		{
        			//w.println("c");
        			ans+=c[i];
        			i++;
        		}
        	}
        //	w.println(ans);
        	h.add(ans);
        		
        }
        	w.println(h.size());
    w.close();
    }
	
	// --------------------My Code Ends Here------------------------
	
	public static String ns()
	{
		return in.nextLine();
	}
	public static int ni()
	{
		return in.nextInt();
	}
	public static long nl()
	{
		return in.nextLong();
	}
	public static void na(int n)
	{
		a=new int[n];
		for(int i=0;i<n;i++)
		a[i]=ni();
	}
	public static void sieveOfEratosthenes()
	    {
	       int n=prime.length;
	        for(int i=0;i<n;i++)
	            prime[i] = true;
	         
	        for(int p = 2; p*p <=n; p++)
	        {
	            if(prime[p] == true)
	            {
	                for(int i = p*2; i <n; i += p)
	                    prime[i] = false;
	            }
	        }
	    }

	public static boolean printDivisors(long n)
    {
		long ans=0;
        for (int i=1; i<=Math.sqrt(n); i++)
        {
            if (n%i==0)
            {
                if (n/i == i)
                    ans++;
                else 
                {
                	ans=ans+2;
                }
            }
            if(ans>3)
            	break;
        }
        if(ans==3)
        	return true;
        else
        	return false;
    }

  public static void dfs(int i)
  {
	  visited[i]=true;
	  for(int j:adj[i])
	  {
		  if(!visited[j])
			  {
			  dfs(j);
			  nodes++;
			  }
	  }
	  
  }
  public static String rev(String s)
	{
		StringBuilder sb=new StringBuilder(s);
		sb.reverse();
		return sb.toString();
	}
	static long lcm(long a, long b)
	{
	    return a * (b / gcd(a, b));
	}
	static long gcd(long a, long b)
	{
	    while (b > 0)
	    {
	        long temp = b;
	        b = a % b; // % is remainder
	        a = temp;
	    }
	    return a;
	}
	static InputReader in;
	static PrintWriter w;
static class InputReader 
{
 
private final InputStream stream;
private final byte[] buf = new byte[8192];
private int curChar, snumChars;
private SpaceCharFilter filter;
 
public InputReader(InputStream stream)
{
  this.stream = stream;
}
 
public int snext()
{
  if (snumChars == -1)
    throw new InputMismatchException();
  if (curChar >= snumChars)
  {
    curChar = 0;
    try 
    {
      snumChars = stream.read(buf);
    }
    catch (IOException e)
    {
      throw new InputMismatchException();
    }
    if (snumChars <= 0)
      return -1;
  }
  return buf[curChar++];
}
 
public int nextInt() 
{
  int c = snext();
  while (isSpaceChar(c)) 
  {
    c = snext();
  }
  int sgn = 1;
  if (c == '-')
  {
    sgn = -1;
    c = snext();
  }
  int res = 0;
  do
  {
    if (c < '0' || c > '9')
      throw new InputMismatchException();
    res *= 10;
    res += c - '0';
    c = snext();
  }
  while (!isSpaceChar(c));
  return res * sgn;
}
 
public long nextLong() 
{
  int c = snext();
  while (isSpaceChar(c)) 
  {
    c = snext();
  }
  int sgn = 1;
  if (c == '-')
  {
    sgn = -1;
    c = snext();
  }
  long res = 0;
  do
  {
    if (c < '0' || c > '9')
      throw new InputMismatchException();
    res *= 10;
    res += c - '0';
    c = snext();
  }
  while (!isSpaceChar(c));
  return res * sgn;
}	    
public String readString() 
{
  int c = snext();
  while (isSpaceChar(c)) 
  {
    c = snext();
  }
  StringBuilder res = new StringBuilder();
  do
  {
    res.appendCodePoint(c);
    c = snext();
  }
  while (!isSpaceChar(c));
  return res.toString();
}
 
public String nextLine() 
{
  int c = snext();
  while (isSpaceChar(c))
    c = snext();
  StringBuilder res = new StringBuilder();
  do
  {
    res.appendCodePoint(c);
    c = snext();
  }
  while (!isEndOfLine(c));
  return res.toString();
}
 
public boolean isSpaceChar(int c)
{
  if (filter != null)
    return filter.isSpaceChar(c);
  return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
}
 
private boolean isEndOfLine(int c) 
{
  return c == '\n' || c == '\r' || c == -1;
}
 
public interface SpaceCharFilter
{
  public boolean isSpaceChar(int ch);
}
}
	
}