#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

int main(){
	int n, q;
	cin >> n >> q;
	string s;
	cin >> s;
	vector<vector<int> > a(500);
	for(int i = 0; i < n; i++){
		a[(int)s[i]].push_back(i);
	}
	char td[q][2];
	for(int i = 0; i < q; i++){
		cin >> td[q-i-1][0] >> td[q-i-1][1];
	}
	bool ch[n]={0};
	for(int i = 0; i < q; i++){
		sort(a[ (int)td[i][0] ].begin(), a[ (int)td[i][0] ].end());
		if(td[i][1] == 'L'){
			for(int j = (int)a[ (int)td[i][0] ].size()-1; j>=0;  j--){
				if(s[ a[(int)td[i][0]][j] ] == td[i][0] && (a[(int)td[i][0]][j] == 0 || ch[ a[(int)td[i][0]][j] -1 ]))ch[ a[(int)td[i][0]][j] ] = true;
			}
		}else{
			for(int j = 0; j < (int)a[ (int)td[i][0] ].size(); j++){
				if(s[ a[(int)td[i][0]][j] ] == td[i][0] && (a[(int)td[i][0]][j] == n-1 || ch[ a[(int)td[i][0]][j] +1 ]))ch[ a[(int)td[i][0]][j] ] = true;
			}
		}
	}
	int ans = 0;
	for(int i = 0; i < n; i++)if(ch[i])ans++;

	cout << n-ans << endl;
    return 0;
}