Buggy python submission (verdict: Runtime Error):
n=int(input())
s=list(input() for i in range(n))
m=[]
a=[]
r=[]
c=[]
h=[]
ans=1
for i in range(n):
    if s[i][0] == "M" and not s[i] in m:
        m.append(s[i])
    elif s[i][0] == "A" and not s[i] in a:
        a.append(s[i])
    elif s[i][0] == "R" and not s[i] in r:
        r.append(s[i])
    elif s[i][0] == "C" and not s[i] in c:
        c.append(s[i])
    elif s[i][0] == "H" and not s[i] in h:
        h.append(s[i])
num=len(m)+len(a)+len(r)+len(c)+len(h)
if num == 0:
    print(0)
else:
    lis = list(len(m),len(a),len(r),len(c),len(h))
    for i in range(5):
        if lis[i]>0:
            ans = ans*lis[i] 
    print(ans)

Fixed submission:
n=int(input())
s=list(input() for i in range(n))
mc=ac=rc=cc=hc=0
cnt=0
for i in range(n):
    if s[i][0] == "M":
        mc+=1
    elif s[i][0] == "A":
        ac+=1
    elif s[i][0] == "R":
        rc+=1
    elif s[i][0] == "C":
        cc+=1
    elif s[i][0] == "H":
        hc+=1
lis = [mc,ac,rc,cc,hc]
if sum(lis) == 0:
    print(0)
else:
    for i in range(5):
        for j in range(i+1,5):
            for k in range(j+1,5):
                cnt+=lis[i]*lis[j]*lis[k]
    print(cnt)

Buggy python submission (verdict: Runtime Error):
m=[]
a=[]
r=[]
c=[]
h=[]
ans=1
for i in range(n):
    if s[i][0] == "M" and not s[i] in m:
        m.append(s[i])
    elif s[i][0] == "A" and not s[i] in a:
        a.append(s[i])
    elif s[i][0] == "R" and not s[i] in r:
        r.append(s[i])
    elif s[i][0] == "C" and not s[i] in c:
        c.append(s[i])
    elif s[i][0] == "H" and not s[i] in h:
        h.append(s[i])
num=len(m)+len(a)+len(r)+len(c)+len(h)
if num == 0:
    print(0)
else:
    lis = list(len(m),len(a),len(r),len(c),len(h))
    for i in range(5):
        ans = ans*lis[i] 
    print(ans)

Fixed submission:
n=int(input())
s=list(input() for i in range(n))
mc=ac=rc=cc=hc=0
cnt=0
for i in range(n):
    if s[i][0] == "M":
        mc+=1
    elif s[i][0] == "A":
        ac+=1
    elif s[i][0] == "R":
        rc+=1
    elif s[i][0] == "C":
        cc+=1
    elif s[i][0] == "H":
        hc+=1
lis = [mc,ac,rc,cc,hc]
if sum(lis) == 0:
    print(0)
else:
    for i in range(5):
        for j in range(i+1,5):
            for k in range(j+1,5):
                cnt+=lis[i]*lis[j]*lis[k]
    print(cnt)

Buggy python submission (verdict: Runtime Error):
import math
n=int(input())
s=list(input() for i in range(n))
m=[]
a=[]
r=[]
c=[]
h=[]
ans=1
for i in range(n):
    if s[i][0] == "M" and not s[i] in m:
        m.append(s[i])
    elif s[i][0] == "A" and not s[i] in a:
        a.append(s[i])
    elif s[i][0] == "R" and not s[i] in r:
        r.append(s[i])
    elif s[i][0] == "C" and not s[i] in c:
        c.append(s[i])
    elif s[i][0] == "H" and not s[i] in h:
        h.append(s[i])
num=len(m)+len(a)+len(r)+len(c)+len(h)
if num == 0:
    print(0)
else:
    lis = list(len(m),len(a),len(r),len(c),len(h))
    ans = ans*lis[i] for i in range(5)
    print(ans)

Fixed submission:
n=int(input())
s=list(input() for i in range(n))
mc=ac=rc=cc=hc=0
cnt=0
for i in range(n):
    if s[i][0] == "M":
        mc+=1
    elif s[i][0] == "A":
        ac+=1
    elif s[i][0] == "R":
        rc+=1
    elif s[i][0] == "C":
        cc+=1
    elif s[i][0] == "H":
        hc+=1
lis = [mc,ac,rc,cc,hc]
if sum(lis) == 0:
    print(0)
else:
    for i in range(5):
        for j in range(i+1,5):
            for k in range(j+1,5):
                cnt+=lis[i]*lis[j]*lis[k]
    print(cnt)