#include using namespace std; int main() { ios::sync_with_stdio(0), cin.tie(0), cout.tie(0); int n, m; cin >> n >> m; int commit[n]{}; bool ac[n]{}; int ans_ac = 0, ans_time = 0; for (int i = 0; i < m; i++) { int id; string result; cin >> id >> result; if (ac[id - 1]) { continue; } if (result == "AC") { ac[id - 1] = true; ans_ac++; ans_time += commit[id - 1]; } else { commit[id - 1] += 1; } } cout << ans_ac << " " << ans_time << endl; }