#include <bits/stdc++.h>
using namespace std;


void solve(long long N, long long M, std::vector<long long> p, std::vector<std::string> S){
    vector<long long> ac(N+1, 0);
    vector<long long> wa(N+1, 0);
    for(int i = 0; i < M; ++i){
        if(ac[p[i]] == 0){
            if(S[i] == "AC") ac[p[i]] = 1;
            else wa[p[i]] += 1;
        }
    }
    //for(auto i : ac) cout << "AC: " << i << endl;
    //for(auto i : wa) cout << "WA: " << i << endl;
    long long cnt_wa = 0;
    for(int i = 0; i < N + 1; ++i){
        if(ac[i] == 1) cnt_wa += wa[i]; 
    }
    cout << accumulate(ac.begin(), ac.end(), 0LL) << " " << cnt_wa << endl;
    return;
}

int main(){
    long long N;
    scanf("%lld",&N);
    long long M;
    scanf("%lld",&M);
    std::vector<long long> p(M);
    std::vector<std::string> S(M);
    for(int i = 0 ; i < M ; i++){
        scanf("%lld",&p[i]);
        std::cin >> S[i];
    }
    solve(N, M, std::move(p), std::move(S));
    return 0;
}

#include <iostream>
#include <algorithm>
#include <cmath>

using namespace std;

const double PI = 3.14159265358979323846;

int main() {
    int n, m, a[1001], b[1001];
    cin >> n >> m;
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
    }
    for (int i = 0; i < m; ++i) {
        cin >> b[i];
    }

    int r[1001] = {};

    for (int i = 0; i < m; ++i) {
        for (int j = 0; j < n; ++j) {
            if (a[j] <= b[i]) {
                r[j]++;
                break;
            }
        }
    }

    int max = 0;
    int maxI = 0;
    for (int k = 0; k < n; ++k) {
        if (max < r[k]) {
            max = r[k];
            maxI = k;
        }
    }

    cout << maxI + 1 << endl;

    return 0;
}