Buggy python submission (verdict: Time Limit Exceeded):
N,M=map(int,input().split())




count_WA=0

AC=[]
x=[]
for i in range(M):
    a=input().split()
    x.append(a)
    if a[1]=="AC" and not(a[0] in AC):
        AC.append(a[0])

count_AC=len(AC)

for i in x:
    if i[0] in AC:
        if i[1]=="AC":

            AC.remove(i[0])
        else:
            count_WA+=1




print(count_AC,count_WA,sep=" ")


Fixed submission:
N,M=map(int,input().split())


ac = 0
wa = 0
aclist = {}
walist = {}

count_WA=0
for i in range(N):
    aclist[i + 1] = 0
    walist[i + 1] = 0

for i in range(M):
    a,b=input().split()
    a=int(a)
    if aclist[a] == 1:
        continue
    elif b == 'WA':
        walist[a] += 1
    elif b == 'AC':
        aclist[a] += 1
        ac += 1
        wa += walist[a]




print(ac,wa,sep=" ")

Buggy python submission (verdict: Runtime Error):
N,M=map(int,input().split())


ac = 0
wa = 0
aclist = {}
walist = {}

count_WA=0
for i in range(n):
    aclist[i + 1] = 0
    walist[i + 1] = 0

for i in range(M):
    a,b=input().split()
    a=int(a)
    if aclist[a] == 1:
        continue
    elif b == 'WA':
        walist[a] += 1
    elif b == 'AC':
        aclist[a] += 1
        ac += 1
        wa += walist[a]




print(ac,wa,sep=" ")


Fixed submission:
N,M=map(int,input().split())


ac = 0
wa = 0
aclist = {}
walist = {}

count_WA=0
for i in range(N):
    aclist[i + 1] = 0
    walist[i + 1] = 0

for i in range(M):
    a,b=input().split()
    a=int(a)
    if aclist[a] == 1:
        continue
    elif b == 'WA':
        walist[a] += 1
    elif b == 'AC':
        aclist[a] += 1
        ac += 1
        wa += walist[a]




print(ac,wa,sep=" ")

Buggy python submission (verdict: Time Limit Exceeded):
N,M=map(int,input().split())




count_WA=0

AC=[]
x=[]
for i in range(M):
    a=input().split()
    x.append(a)
    if a[1]=="AC" and not(a[0] in AC):
        AC.append(a[0])

count_AC=len(AC)

for i in x:
    if i[0] in AC:
        if i[1]=="AC":
            AC.remove(i[0])
        else:
            count_WA+=1




print(count_AC,count_WA,sep=" ")


Fixed submission:
N,M=map(int,input().split())


ac = 0
wa = 0
aclist = {}
walist = {}

count_WA=0
for i in range(N):
    aclist[i + 1] = 0
    walist[i + 1] = 0

for i in range(M):
    a,b=input().split()
    a=int(a)
    if aclist[a] == 1:
        continue
    elif b == 'WA':
        walist[a] += 1
    elif b == 'AC':
        aclist[a] += 1
        ac += 1
        wa += walist[a]




print(ac,wa,sep=" ")

Buggy python submission (verdict: Time Limit Exceeded):
N,M=map(int,input().split())




count_WA=0

AC=[]
x=[]
for i in range(M):
    a=input().split()
    x.append(a)
    if a[1]=="AC" and not(a[0] in AC):
        AC.append(a[0])

count_AC=len(AC)

for i in x:
    if i[0] in AC:
        if i[1]=="AC":

            AC.remove(i[0])
        else:
            count_WA+=1




print(count_AC,count_WA,sep=" ")


Fixed submission:
N,M=map(int,input().split())


ac = 0
wa = 0
aclist = {}
walist = {}

count_WA=0
for i in range(N):
    aclist[i + 1] = 0
    walist[i + 1] = 0

for i in range(M):
    a,b=input().split()
    a=int(a)
    if aclist[a] == 1:
        continue
    elif b == 'WA':
        walist[a] += 1
    elif b == 'AC':
        aclist[a] += 1
        ac += 1
        wa += walist[a]




print(ac,wa,sep=" ")

Buggy python submission (verdict: Time Limit Exceeded):
N,M=map(int,input().split())




count_WA=0

AC=[]
x=[]
for i in range(M):
    a=input().split()
    x.append(a)
    if a[1]=="AC" and not(a[0] in AC):
        AC.append(a[0])

count_AC=len(AC)

for i in x:
    if i[0] in AC:
        if i[1]=="AC":

            AC.remove(i[0])
        else:
            count_WA+=1




print(count_AC,count_WA,sep=" ")


Fixed submission:
N,M=map(int,input().split())


ac = 0
wa = 0
aclist = {}
walist = {}

count_WA=0
for i in range(N):
    aclist[i + 1] = 0
    walist[i + 1] = 0

for i in range(M):
    a,b=input().split()
    a=int(a)
    if aclist[a] == 1:
        continue
    elif b == 'WA':
        walist[a] += 1
    elif b == 'AC':
        aclist[a] += 1
        ac += 1
        wa += walist[a]




print(ac,wa,sep=" ")

Buggy python submission (verdict: Time Limit Exceeded):
N,M=map(int,input().split())


a=[]

count_WA=0
for i in range(M):
    a.append(input().split())


AC=[]
for i in a:
    if i[1]=="AC" and not(i[0] in AC):
        AC.append(i[0])
count_AC=len(AC)

for i in a:
    if i[0] in AC:
        if i[1]=="AC":

            AC.remove(i[0])
        else:
            count_WA+=1




print(count_AC,count_WA,sep=" ")


Fixed submission:
N,M=map(int,input().split())


ac = 0
wa = 0
aclist = {}
walist = {}

count_WA=0
for i in range(N):
    aclist[i + 1] = 0
    walist[i + 1] = 0

for i in range(M):
    a,b=input().split()
    a=int(a)
    if aclist[a] == 1:
        continue
    elif b == 'WA':
        walist[a] += 1
    elif b == 'AC':
        aclist[a] += 1
        ac += 1
        wa += walist[a]




print(ac,wa,sep=" ")

Buggy python submission (verdict: Time Limit Exceeded):
N,M=map(int,input().split())


a=[]
count_AC=0
count_WA=0
for i in range(M):
    a.append(input().split())


AC=[]
for i in a:
    if i[1]=="AC" and not(i[0] in AC):
        AC.append(i[0])
for i in a:
    if i[0] in AC:
        if i[1]=="AC":
            count_AC+=1
            AC.remove(i[0])
        else:
            count_WA+=1




print(count_AC,count_WA,sep=" ")


Fixed submission:
N,M=map(int,input().split())


ac = 0
wa = 0
aclist = {}
walist = {}

count_WA=0
for i in range(N):
    aclist[i + 1] = 0
    walist[i + 1] = 0

for i in range(M):
    a,b=input().split()
    a=int(a)
    if aclist[a] == 1:
        continue
    elif b == 'WA':
        walist[a] += 1
    elif b == 'AC':
        aclist[a] += 1
        ac += 1
        wa += walist[a]




print(ac,wa,sep=" ")