Hackerrank All Women's Codesprint 2019: Name the Product
Imports
import math, os, random, re, sys
from collections import defaultdict as dd, Counter as count

Seriously, don't do this. It may be useful to read PEP8 regarding imports again.

Imports should be on separate lines.

Why do Counter as count?  It impairs readability.
Especially in larger scripts, every Python dev knows Counter, but count could be a random variable and is easy to be overshadowed.

You don't use all of the imported modules; just remove them if you don't need them.


   alphabet = &quot;abcdefghijklmnopqrstuvwxyz&quot;

Here you missed something that is in the standard lib: from string import ascii_lowercase


Misc

This dd(lambda: 0, ... adds no value
Counter is already a dictionary with default value 0 just remove that part

Magic numbers
5 is a Magic number, you should define it as a CONSTANT:
  NAME_LENGTH = 5



The rest looks good!