Buggy python submission (verdict: Runtime Error):
N,M=map(int,input().split())
N=[[0,0]]*(N+1)
L=list(list(map(input().split())) for j in range(M))
win=0
penalty=0
if M==0:
  print(0,0)
else:
  for i in range(M):
    m=int(L[i][0])
    eff=str(L[i][1])
    if eff=="WA":
      if N[m][0]!=1:
        N[m][1]+=1
      else:
        continue
    else:
      if N[m][0]!=1:
        N[m][0]=1
        win+=1
        penalty+=N[m][1]
      else:
        continue
  print(win,penalty)
      


Fixed submission:
n,m=map(int,input().split())
ps=[list(input().split()) for i in range(m)]
pen=[0]*n
rig=[0]*n

for i in range(m):
  if ps[i][1] == "AC":
    rig[int(ps[i][0])-1]=1
  else:
    if rig[int(ps[i][0])-1] == 0:
      pen[int(ps[i][0])-1]+=1

cnt1,cnt2=0,0
for i in range(n):
  if rig[i]==1:
    cnt1+=rig[i]
    cnt2+=pen[i]
    
print(str(cnt1)+" "+str(cnt2))

Buggy python submission (verdict: Runtime Error):
N,M=map(int,input().split())
N=[[0,0]]*(N+1)
L=list(list(map(str,input().split())) for j in range(M))
win=0
peanalty=0
if M==0:
  print(0,0)
else:
  for i in range(M):
    m=int(L[i][0])
    eff=L[i][1]
    if eff=="WA":
      if N[m][0]!=1:
        N[m][1]+=1
      else:
        continue
    else:
      if N[m][0]!=1:
        N[m][0]=1
        win+=1
        penalty+=N[m][1]
      else:
        continue
  print(win,penalty)
      


Fixed submission:
n,m=map(int,input().split())
ps=[list(input().split()) for i in range(m)]
pen=[0]*n
rig=[0]*n

for i in range(m):
  if ps[i][1] == "AC":
    rig[int(ps[i][0])-1]=1
  else:
    if rig[int(ps[i][0])-1] == 0:
      pen[int(ps[i][0])-1]+=1

cnt1,cnt2=0,0
for i in range(n):
  if rig[i]==1:
    cnt1+=rig[i]
    cnt2+=pen[i]
    
print(str(cnt1)+" "+str(cnt2))

Buggy python submission (verdict: Runtime Error):
N,M=map(int,input().split())
N=[[0,0]]*(N+1)
if M==0:
  print(0,0)
else:
  penalty=0
  win=0
  for j in range(M):
    L=list(map(str,input().split()))
    m=int(L[0])
    if L[1]=="WA":
      if N[m][1]!=1:
        penalty+=1
      else:
        continue
    else:
      if N[m][1]!=1:
        N[m][1]=1
        win+=1
      else:
        continue
print(win,penalty)

Fixed submission:
n,m=map(int,input().split())
ps=[list(input().split()) for i in range(m)]
pen=[0]*n
rig=[0]*n

for i in range(m):
  if ps[i][1] == "AC":
    rig[int(ps[i][0])-1]=1
  else:
    if rig[int(ps[i][0])-1] == 0:
      pen[int(ps[i][0])-1]+=1

cnt1,cnt2=0,0
for i in range(n):
  if rig[i]==1:
    cnt1+=rig[i]
    cnt2+=pen[i]
    
print(str(cnt1)+" "+str(cnt2))

Buggy python submission (verdict: Runtime Error):
N,M=map(int,input().split())
N=[[0,0]]*(N+1)
if M==0:
  print(0,0)
else:
  penalty=0
  win=0
  for j in range(M):
    L=list(map(str,input().split()))
    m=int(L[0])
    if L[1]=="WA":
      if N[m]!=1:
        penalty+=1
      else:
        continue
    else:
      if N[m]!=1:
        N[m]=1
        win+=1
      else:
        continue
print(win,penalty)
    
  

Fixed submission:
n,m=map(int,input().split())
ps=[list(input().split()) for i in range(m)]
pen=[0]*n
rig=[0]*n

for i in range(m):
  if ps[i][1] == "AC":
    rig[int(ps[i][0])-1]=1
  else:
    if rig[int(ps[i][0])-1] == 0:
      pen[int(ps[i][0])-1]+=1

cnt1,cnt2=0,0
for i in range(n):
  if rig[i]==1:
    cnt1+=rig[i]
    cnt2+=pen[i]
    
print(str(cnt1)+" "+str(cnt2))