#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  string s;
  map<char, int> mp;
  cin >> s;
  for (char x : s) {
    mp[x - 'a'] = 1;
  }
  for (int i = 0; i < k; i++) {
    char l, d;
    cin >> l >> d;
    if (mp[l - 'a'] == 1 && l == s[0] && d == 'L') {
      mp[l - 'a'] = 0;
    }
    if (mp[l - 'a'] == 1 && l == s[n - 1] && d == 'R') {
      mp[l - 'a'] = 0;
    }
    if (d == 'L' && mp[l - 'a'] != 0) {
      mp[l - 'a' - 1] = 1;
      mp[l - 'a'] = 0;
    } else if (d == 'R' && mp[l - 'a'] != 0) {
      mp[l - 'a' + 1] = 1;
      mp[l - 'a'] = 0;
    } else {
    }
  }
  int cnt = 0;
  for (auto x : mp) {
    if (x.second == 1) {
      cnt++;
    }
  }
  cout << cnt;
}
