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: num = list(map(int, input().split()))
  
  if num[1] == 0:
      count_ac_all = 0
      count_wa_all = 0
  
  else:
      group = set()
      new_num = []
      num_list = []
  
      for i in range(0, num[1]):
          num_list.append(list(input().split()))
      #    group.add(num_list[i][0])
  
      #
      #  set_list = list(group)
      #  num_list_1 = num_list
      #  for i in range(0,len(set_list)):
      #    for j in range(0,len(num_list_1)):
      #      if num_list[j][0] == set_list[i]:
      ##        new_num.append(num_list[j])
      #        num_list_1.remove(num_list[j])
      #    num_list = num_list_1
  
      count_ac = 0
      count_wa = 0
      count_ac_all = 0
      count_wa_all = 0
      base = num_list[0][0]
      count = 0
      set_list = []
  
      for i in range(0, len(num_list)):
          if not num_list[i][0] in set_list:
              if not num_list[i][0] == base:
                  base = num_list[i][0]
                  count = 0
                  count_ac = 0
                  count_wa = 0
  
              if count == 0:
                  if num_list[i][1] == "WA":
                      count_wa = count_wa + 1
                  elif num_list[i][1] == "AC":
                      count_ac = count_ac + 1
                      count = 1
  
              if count == 1:
                  count_ac_all = count_ac_all + count_ac
                  count_wa_all = count_wa_all + count_wa
                  count = -1
                  set_list.append(num_list[i][0])
  
  print(count_ac_all, count_wa_all)
  
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"}]