#include <cstdio>
#include <algorithm>
#define DIM 10000
#define NMax 1400000
#define mp make_pair
using namespace std;
char buff[DIM];
int poz;
pair<int, int> xc[NMax+1];
pair<int, int> yc[NMax+1];
pair<int, int> tx[NMax+1];
pair<int, int> ty[NMax+1];
int dirx[12]={0,1,0,-1,1,1,-1,-1,0,2,0,-2};
int diry[12]={1,0,-1,0,1,-1,1,-1,2,0,-2,0};
int N,M,o;
long long ans;
void get_nr(int& numar)
{
char sgn='+';
numar = 0;
while(buff[poz]<'0'||buff[poz]>'9')
{
sgn = buff[poz];
if(++poz==DIM) fread(buff,1,DIM,stdin),poz=0;
}
while(buff[poz]>='0'&&buff[poz]<='9')
{
numar = numar*10 + buff[poz]-'0';
if(++poz==DIM) fread(buff,1,DIM,stdin),poz=0;
}
if(sgn=='-') numar = -numar;
}
void get_ch(char& chr)
{
chr = buff[poz];
if(++poz==DIM) fread(buff,1,DIM,stdin),poz=0;
}
int Search(pair<int, int> v[], pair<int, int> t)
{
int st,dr,mid,f=1;
if( v[o] <= t ) return o+1;
for(st = 1, dr = o; st <= dr;)
{
mid = (st+dr)/2;
if( v[mid] <= t ) st = mid+1;
else { f = mid; dr = mid-1; }
}
return f;
}
int main(){
freopen("zc.in","r",stdin);
freopen("zc.out","w",stdout);
int i,j,k,nc,v,x,y,xi,yi;
char ch,pass;
scanf("%d %d\n",&N,&M);
for(nc = 0, i = 1; i <= N; ++i)
{
get_nr(x); get_nr(y);
if( x || y )
{
++nc;
tx[nc] = mp(x,y);
ty[nc] = mp(y,x);
}
for(k = 0; k < 12; ++k)
if( ( x+dirx[k] ) || ( y+diry[k] ) )
{
++nc;
tx[nc] = mp(x+dirx[k],y+diry[k]);
ty[nc] = mp(y+diry[k],x+dirx[k]);
}
}
sort(tx+1,tx+nc+1);
sort(ty+1,ty+nc+1);
for(o = 0, i = 1; i <= nc; )
{
for(j = i; tx[i]==tx[j] && j <= nc; ++j);
xc[++o] = tx[i];
i = j;
}
for(o = 0, i = 1; i <= nc; )
{
for(j = i; ty[i]==ty[j] && j <= nc; ++j);
yc[++o] = ty[i];
i = j;
}
x = y = 0;
get_ch(pass);
for(i = 1; i <= M; ++i)
{
get_ch(ch); get_nr(v);
get_ch(pass);
xi = x; yi = y;
if(ch=='N') { y = y+v; nc = Search( xc, mp(x,y) ) - Search( xc, mp(xi,yi) ); }
else if(ch=='E') { x = x+v; nc = Search( yc, mp(y,x) ) - Search( yc, mp(yi,xi) ); }
else if(ch=='S') { y = y-v; nc = Search( xc, mp(xi,yi-1) ) - Search( xc, mp(x,y-1) ); }
else { x = x-v; nc = Search( yc, mp(yi,xi-1) ) - Search( yc, mp(y,x-1) ); }
ans = ans + nc;
}
printf("%lld\n",ans);
return 0;
}