#include <bits/stdc++.h>
using namespace std;
int cnt[100][100];
int main() {
  int n, Q;
  cin >> n >> Q;
  string s;
  cin >> s;
  int t[Q], d[Q];
  map<char, int> mp;
  for (int i = 0; i < Q; i++) {
    cin >> t[i] >> d[i];
  }
  for (int i = 0; i < Q; i++) {
    if (d[i] == 'L') {
      mp[d[i]]--;
    } else {
      mp[d[i]]++;
    }
    cnt[0][d[i] - 'A'] = min(cnt[0][d[i] - 'A'], mp[d[i]]);
    cnt[1][d[i] - 'A'] = max(cnt[1][d[i] - 'A'], mp[d[i]]);
  }
  s = '1' + s;
  int ans = 0;
  for (int i = 1; i < s.size(); i++) {
    int x = i;
    cout << x << endl;
    if (x + cnt[0][s[i] - 'A'] <= 0 || x + cnt[0][s[i] - 'A'] > n) {
      ans++;
    } else if (x + cnt[1][s[i] - 'A'] <= 0 || x + cnt[1][s[i] - 'A'] > n) {
      ans++;
    }
  }
  cout << n - ans << endl;
}
