#include <bits/stdc++.h>
#define rep(i,n) for (int i=0; i<(int)(n); i++)
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main() {
  int n, m; cin >> n >> m;
  vector<int> p(n+1,0);
  vector<bool> ac(n+1);
  int ac_cnt = 0, pe_cnt = 0;
  rep(i,m) {
    int pi; string si; cin >> pi >> si;
    if (!ac[pi]) {
      if (si == "WA") {
        p[pi]++;
      } else {
        ac_cnt++;
        pe_cnt += p[pi];
        ac[pi] = true;
      }
    }
  }
  cout << ac_cnt << " " << pe_cnt << endl;
  return 0;
}
#include <bits/stdc++.h>
using namespace std;

int main () {
  int d, g;
  cin >> d >> g;
  vector<pair<int,int>> p(d);
  for (int i = 0; i < d; i++)
    cin >> p[i].first >> p[i].second;
  
  vector<int> v(d);
  iota (v.begin(), v.end(), 0);
  int ans = 1000;
  do {
    int sum = 0, c = 0;
    for (int i = 0; i < d; i++) {
      int x = v[i];
      int i100 = 100 * (x+1);
      int pi100 = p[x].first * i100;
      if (g > sum + pi100 + p[x].second) {
        sum += pi100 + p[x].second;
        c += p[x].first;
      }
      else if (sum + pi100 <= g &&
               g <= sum + pi100 + p[x].second) {
        c += p[x].first;
        break;
      }
      else {
        c += (g - sum + i100-1) / i100;
        break;
      }
    }
    ans = min(ans, c);
  }
  while (next_permutation(v.begin(), v.end()));
  
  cout << ans << endl;
}
