output_description: Print the number of Takahashi's correct answers and the number of Takahashi's
  penalties.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N M
      p_1 S_1
      :
      p_M S_M
attempt: # coding: utf-8
  # Your code here!
  
  
  def pin(type=int):
      return map(type, input().split())
  
  
  # 1行ごとに読み込んでいる
  # 変数一個だけのときはカンマを入れるだけ、input()相当。ちょろい。
  # sum関数などintを相手にした関数を書く時に便利なのでデフォルトをint型にする
  
  N, M = pin()
  p = [0 for j in range(0, M)]
  S = [0 for j in range(0, M)]
  for j in range(0, M):
      p[j], S[j] = pin(str)  # p_i,S_iにそれぞれ対応
      # print("sah")
  # O(3M)...?
  # print(p)
  # print(p,S)
  # ACした問題番号と各々の問題（後々AC下かを考えない）ペナ数を問題番号別にまとめた配列
  AC = [0 for i in range(0, N)]
  Penalties = [0 for i in range(0, N)]
  
  # 問題番号iと回答番号jについて,
  """
  for i in range(0,N):
      for j in range(0,M):
      
          #jがiの回答である時に,WAだったらPenaltiesに1個加算
          if int(p[j])-1==i:
              if (S[j]) == 'WA':
                  Penalties[int(p[j])-1] += 1
              else:#それが初めてのACならば、AC数に1を足してcontinueで次の問題i+1へ移る
                  AC[int(p[j])-1] = 1
                  break
              #print(AC,Penalties)
  """
  # double-loop だと　TLEしてしまう O(n^2)はだめみたい
  
  # singleloopしかないねぇ
  # 回答番号jに着目する
  for j in range(0, M):
      if S[j] == "AC":
          if AC[int(p[j]) - 1] == 1:
              continue
          else:
              AC[int(p[j]) - 1] = 1
      else:  # wa or something
          if AC[int(p[j]) - 1] == 1:
              continue
          else:
              Penalties[int(p[j]) - 1] += 1
  # print(AC,Penalties)
  
  for i in range(0, N):
      if AC[i] == 0:
          Penalties[i] = 0
  # print("///////")
  # print(AC,Penalties)
  
  
  # ACリスト内の1の数を数えるのは iter.countだね
  print(AC.count(1), sum(Penalties))
  
problem_description: Statement
  
  Takahashi participated in a contest on AtCoder.
  
  The contest had N problems.
  
  Takahashi made M submissions during the contest.
  
  The i-th submission was made for the p_i-th problem and received the verdict
  S_i (`AC` or `WA`).
  
  The number of Takahashi's correct answers is the number of problems on which
  he received an `AC` once or more.
  
  The number of Takahashi's penalties is the sum of the following count for the
  problems on which he received an `AC` once or more: the number of `WA`s
  received before receiving an `AC` for the first time on that problem.
  
  Find the numbers of Takahashi's correct answers and penalties.
samples: [{"input": "2 5\n    1 WA\n    1 AC\n    2 WA\n    2 AC\n    2 WA", "output": "2 2\n    \n\nIn his second submission, he received an `AC` on the first problem for the\nfirst time. Before this, he received one `WA` on this problem.\n\nIn his fourth submission, he received an `AC` on the second problem for the\nfirst time. Before this, he received one `WA` on this problem.\n\nThus, he has two correct answers and two penalties.\n\n* * *"}, {"input": "100000 3\n    7777 AC\n    7777 AC\n    7777 AC", "output": "1 0\n    \n\nNote that it is pointless to get an `AC` more than once on the same problem.\n\n* * *"}, {"input": "6 0", "output": "0 0"}]