nclude <iostream>
#include <fstream>
#include <bits/stdc++.h>
using namespace std;
ifstream fin("radacina.in");
ofstream fout("radacina.out");
int N,Q,s,minimal=1e18;
const int zecimala=1e5;
vector<pair<char,char > > v;
bool Golems[20010];
map <char,int> Letters;
int cntGolems;
bool comparator(double firstTerm,double secondTerm)
{
    return (abs(firstTerm-secondTerm)<(1e-5));
}
 
double cautare(double st,double dr)
{
    double mij;
    while(st<=dr)
    {
        mij=(st+dr)/2;
        double x,y;
    }
}
int cautareLeft()
{
    
}
int cautareRight()
{
    
}
int main()
{
    cin>>N>>Q;
    cin>>s;
    for(i=0;i<s.size();i++)
    {
        Letters[s[i]]=i;
    }
    cntGolems=n;
    for(i=1;i<=Q;i++)
    {
        char x,y;
        cin>>x>>y;
        v.push_back({x,y});
        Golems[i-1]=1;
    }
    for(i=0;i<=Q-1;i++)
    {
        char dir=v[i].second;
        if(dir=='R')
        {
            if(i==Q-1)
            {
                cntGolems--;
                Golems[i]=0;
            }
        }
        else//dir=='L'
        {
            if(i==0)
            {
                cntGolems--;
                Golems[i]=0;
            }
        }
    }
    cout<<cntGolems;
    fin.close();
    fout.close();
    return 0;
}