Buggy python submission (verdict: Runtime Error):
n = int(input())
march = {'M':0, 'A':0, 'R':0, 'C':0, 'H':0}
for i in range(n):
    str = input()
    if str[0] in march:
        march[str[0]] += 1
for i in list(march):
    if march[i] == 0:
        march.pop(i)
c = 0
if len(march) == 3:
    tmpc = 1
    for chr in march:
        tmpc *= march[chr]
    c += tmpc
elif len(march) == 4:
    for i in march:
        tmpm = march.copy()
        tmpm.pop(i)
        tmpc = 1
        for chr in tmpm:
            tmpc *= tmpm[chr]
        c += tmpc
elif len(march) == 5:
    for i in march:
        tmpm1 = march.copy()
        tmpm1.pop(i)
        for j in tmpm1:
            tmpm2 = tmpm1.copy()
            tmpm2.pop(j)
            tmpc = 1
            for chr in tmpm:
                tmpc *= tmpm[chr]
            c += tmpc
print(c)

Fixed submission:
n = int(input())
march = {'M':0, 'A':0, 'R':0, 'C':0, 'H':0}
for i in range(n):
    str = input()
    if str[0] in march:
        march[str[0]] += 1
for i in list(march):
    if march[i] == 0:
        march.pop(i)
c = 0
if len(march) == 3:
    tmpc = 1
    for chr in march:
        tmpc *= march[chr]
    c += tmpc
elif len(march) == 4:
    for i in march:
        tmpm = march.copy()
        tmpm.pop(i)
        tmpc = 1
        for chr in tmpm:
            tmpc *= tmpm[chr]
        c += tmpc
elif len(march) == 5:
    keys = list(march.keys())
    for i in range(len(keys)):
        for j in range(i + 1, len(keys)):
            tmpm = march.copy()
            tmpm.pop(keys[i])
            tmpm.pop(keys[j])
            tmpc = 1
            for chr in tmpm:
                tmpc *= tmpm[chr]
            c += tmpc
print(c)

Buggy python submission (verdict: Runtime Error):
n = int(input())
march = {'M':0, 'A':0, 'R':0, 'C':0, 'H':0}
for i in range(n):
    str = input()
    if str[0] in march:
        march[str[0]] += 1

for i in list(march):
    if march[i] == 0:
        march.pop(i)

c = 0
if len(march) == 3:
    tmpc = 1
    for chr in march:
        tmpc *= march[chr]
    c += tmpc
elif len(march) == 4:
    for i in march:
        tmpm = march.copy()
        tmpm.pop(i)
        tmpc = 1
        for chr in tmpm:
            tmpc *= tmpm[chr]
        c += tmpc
elif len(march) == 5:
    for i in march:
        tmpm1 = march.copy()
        tmpm1.pop(i)
        for j in tmpm1:
            tmpm2 = tmpm1.copy()
            tmpm2.pop(j)
            tmpc = 1
            for chr in tmpm:
                tmpc *= tmpm[chr]
            c += tmpc
print(c)

Fixed submission:
n = int(input())
march = {'M':0, 'A':0, 'R':0, 'C':0, 'H':0}
for i in range(n):
    str = input()
    if str[0] in march:
        march[str[0]] += 1
for i in list(march):
    if march[i] == 0:
        march.pop(i)
c = 0
if len(march) == 3:
    tmpc = 1
    for chr in march:
        tmpc *= march[chr]
    c += tmpc
elif len(march) == 4:
    for i in march:
        tmpm = march.copy()
        tmpm.pop(i)
        tmpc = 1
        for chr in tmpm:
            tmpc *= tmpm[chr]
        c += tmpc
elif len(march) == 5:
    keys = list(march.keys())
    for i in range(len(keys)):
        for j in range(i + 1, len(keys)):
            tmpm = march.copy()
            tmpm.pop(keys[i])
            tmpm.pop(keys[j])
            tmpc = 1
            for chr in tmpm:
                tmpc *= tmpm[chr]
            c += tmpc
print(c)