#include <bits/stdc++.h>
using namespace std;
void ml(vector<vector<int>>& pla, vector<int>& sim, char pos) {
  for (int i : pla[pos - 'A']) {
    sim[i - 1] += sim[i];
    sim[i] = 0;
  }
}
void mr(vector<vector<int>>& pla, vector<int>& sim, char pos) {
  for (int i : pla[pos - 'A']) {
    sim[i + 1] += sim[i];
    sim[i] = 0;
  }
}
signed main() {
  int a, q;
  cin >> a >> q;
  vector<vector<int>> pla(27, vector<int>());
  vector<int> sim(a + 2, 1);
  string b;
  cin >> b;
  int j = 1;
  for (auto i : b) {
    pla[i - 'A'].push_back(j);
    j++;
  }
  for (int i = 0; i < q; i++) {
    char pos, l;
    cin >> pos >> l;
    if (l == 'L') {
      ml(pla, sim, pos);
    } else {
      mr(pla, sim, pos);
    }
  }
  int ans;
  ans = a - sim[0] - sim[j] + 2;
  cout << ans;
}
