#include <cstdio>
#include <algorithm>
#define x first
#define y second
using namespace std;
typedef pair<int, int> point;
const int N = 1400000;
int n, m, nrt, nr, xc, yc, nextx, nexty;
point v[N], p[N];
void make_points(point a) {
v[++nrt].x = a.y - 2;
v[nrt].y = a.x;
v[++nrt].x = a.y + 2;
v[nrt].y = a.x;
for (int i = a.x - 1; i <= a.x + 1; ++i) {
v[++nrt].x = i;
v[nrt].y = a.y - 1;
v[++nrt].x = i;
v[nrt].y = a.y + 1;
}
for (int i = a.x - 2; i <= a.x + 2; ++i) {
v[++nrt].x = i;
v[nrt].y = a.y;
}
}
void read() {
scanf("%d%d\n", &n, &m);
for (int i = 1; i <= n; ++i)
scanf("%d%d\n", &v[i].x, &v[i].y);
nrt = n;
for (int i = 1; i <= n; ++i)
make_points(v[i]);
}
bool cmp(point a, point b) {
if (a.y < b.y)
return true;
if (a.y > b.y)
return false;
return (a.x <= b.x);
}
void duplicates() {
sort(v + 1, v + nrt + 1);
for (int i = 1; i <= nrt; ++i) {
p[++nr] = v[i];
while (v[i] == v[i + 1] && i < nrt)
++i;
}
v[nr + 1].x = v[nr + 1].y = 2000000005;
for (int i = 1; i <= nr; ++i)
v[i] = p[i];
sort(v + 1, v + nr + 1, cmp);
}
int begin_binary_search(int number, bool type, int start, int fin, point a[N]) {
int i, pas = 1 << 21;
for (i = start; pas; pas >>= 1)
if (i + pas <= fin && type && a[i + pas].y < number)
i += pas;
else
if (i + pas <= fin && !type && a[i + pas].x < number)
i += pas;
return i + 1;
}
int end_binary_search(int number, bool type, int start, int fin, point a[N]) {
int i, pas = 1 << 21;
for (i = start; pas; pas >>= 1)
if (i + pas <= fin && type && a[i + pas].y <= number)
i += pas;
else
if (i + pas <= fin && !type && a[i + pas].x <= number)
i += pas;
return i;
}
int search(char dir, int lg) {
int plusx = 0, plusy = 0;
if (dir == 'N')
plusy = 1;
else
if (dir == 'S')
plusy = -1;
else
if (dir == 'E')
plusx = 1;
else
plusx = -1;
nextx = xc + plusx * lg;
nexty = yc + plusy * lg;
int begin, end, left, right;
if (plusx) {
begin = begin_binary_search(yc, true, 0, nr, v);
end = end_binary_search(yc, true, 0, nr, v);
if (v[begin].y != yc)
return 0;
left = begin_binary_search(xc, false, begin - 1, end, v);
right = end_binary_search(nextx, false, begin - 1, end, v);
return right - left + 1;
}
begin = begin_binary_search(xc, false, 0, nr, p);
end = end_binary_search(xc, false, 0, nr, p);
if (p[begin].x != xc)
return 0;
left = begin_binary_search(yc, true, begin - 1, end, p);
right = end_binary_search(nexty, true, begin - 1, end, p);
return right - left + 1;
}
void solve() {
int total = 0;
for (int i = 1; i <= m; ++i) {
char dir;
int lg;
scanf("%c %d\n", &dir, &lg);
total += search(dir, lg);
xc = nextx;
yc = nexty;
}
printf("%d\n", total);
}
int main() {
freopen("zc.in", "r", stdin);
freopen("zc.out", "w", stdout);
read();
duplicates();
solve();
return 0;
}