def check(pos):
if car[pos]==0:
return True
return False
def change(pos):
car[pos] = 1
r,c,n=list(map(int,input().split(" ")))
wrong=n
car=[0]*r*c
for i in range(n):
inp=list(map(str,input().split(" ")))
inp[1]=int(inp[1])
if inp[0]=="A":
t=c
exit=False
for j in range(c):
for k in range(4):
if check(inp[1]*c + t-1 + k*c):
pass
else:
exit=True
break
if exit:
break
t-=1
if t!=c:
wrong-=1
for k in range(4):
change(inp[1]*c + t + k*c)
elif inp[0]=="B":
t=c-2
exit=False
for j in range(c-2):
for k in range(3):
if check(inp[1]*c + t-1 + k ):
pass
else:
exit=True
break
if exit:
break
t-=1
if t!=c-2:
wrong-=1
for k in range(3):
change(inp[1]*c + t + k)
elif inp[0]=="C":
t=c-1
exit=False
for j in range(c-1):
for k in range(2):
for k2 in range(2):
if check(inp[1]*c + t-1 +k +k2*c):
pass
else:
exit=True
break
if exit:
break
if exit:
break
t-=1
if t!=c-1:
wrong-=1
for k in range(2):
for k2 in range(2):
change(inp[1]*c + t + k + k2*c)
elif inp[0]=="D":
t=c-2
exit=False
for j in range(c-2):
for k in range(2):
for k2 in range(3):
if k==0 and (k2==1 or k2==0):
continue
if check(inp[1]*c + t-1 + k*c +k2):
pass
else:
exit=True
break
if exit:
break
if exit:
break
t-=1
if t!=c-2:
wrong-=1
for k in range(2):
for k2 in range(3):
if k==0 and (k2==1 or k2==0):
continue
change(inp[1]*c + t + k*c + k2)
elif inp[0]=="E":
t=c-1
exit=False
for j in range(c-1):
for k in range(3):
for k2 in range(2):
if k==0 and k2==0:
continue
if check(inp[1]*c + t-1 + k*c + k2):
pass
else:
exit=True
break
if exit:
break
if exit:
break
t-=1
if t!=c-1:
wrong-=1
for k in range(3):
for k2 in range(2):
if k==0 and k2==0:
continue
change(inp[1]*c + t + k*c + k2)
print(r*c-sum(car),wrong)