#include<set>
class Solution {
public:
string code[26]={".-","-...","-.-.","-..",".","..-.","--.","....","..",".---","-.-",".-..","--","-.","---",".--.","--.-",".-.","...","-","..-","...-",".--","-..-","-.--","--.."};
int uniqueMorseRepresentations(vector<string>& words) {
int l = words.size();
set<string> de;
for(int i =0;i<l;i++)
{
string tmp;
for(int j=0;j<words[i].length();j++)
{
tmp += code[words[i][j]-'a'];
}
if(de.find(tmp)!=de.end())continue;
else de.insert(tmp);
}
return de.size();
}
};