class Solution:
    def numUniqueEmails(self, emails):
        """
        :type emails: List[str]
        :rtype: int
        """
        unqique_emails = set()
        for e in emails:
            # separate local name and domain name
            i = e.index('@')
            old_local = e[:i]
            domain = e[i+1:]
            local = ''
            # strip . and + in local name
            for letter in old_local:
                if letter == '+':
                    break
                if letter != '.':
                    local += letter
            # compare local names and domain names
            email = local + '@' + domain
            unqique_emails.add(email)
        return len(unqique_emails)
