#include <bits/stdc++.h>
using namespace std;
const int dx[4] = {-1, -1, 1, 1};
const int dy[4] = {1, -1, 1, -1};
vector<int> p1[200010], p2[200010];
vector<pair<int, int> > a[200010], b[200010];
int n, m;
bool count(int x, int y) {
  return *lower_bound(p1[x + y].begin(), p1[x + y].end(), x) == x;
}
int ID(char *a) {
  if (a[0] == 'N' && a[1] == 'E') return 0;
  if (a[0] == 'N' && a[1] == 'W') return 1;
  if (a[0] == 'S' && a[1] == 'E') return 2;
  return 3;
}
void doit(int x, int y, int d) {
  int sx = x, sy = y, cur = 0;
  for (;;) {
    vector<int> &v = d == 1 || d == 2 ? p2[x - y + m + 1] : p1[x + y];
    vector<int>::iterator it = upper_bound(v.begin(), v.end(), x);
    if (d <= 1) it--;
    int px = *it, py = d == 1 || d == 2 ? px - (x - y) : x + y - px;
    int px1 = px, py1 = py - dy[d], px2 = px - dx[d], py2 = py;
    bool c1 = count(px1, py1), c2 = count(px2, py2);
    vector<pair<int, int> > &v1 =
        d == 1 || d == 2 ? b[x - y + m + 1] : a[x + y];
    int lx = x, ly = y, rx = px, ry = py;
    if (c1 && c2) {
      v1.push_back(make_pair(px2, x));
      x = px2;
      y = py1;
      d = 3 - d;
    } else if (c1 && !c2) {
      v1.push_back(make_pair(px2, x));
      x = px2;
      y = py2;
      d ^= 2;
    } else if (!c1 && c2) {
      v1.push_back(make_pair(px2, x));
      x = px1;
      y = py1;
      d ^= 1;
    } else {
      v1.push_back(make_pair(px2, x));
      x = px2;
      y = py1;
      d = 3 - d;
    }
    if (lx > rx) {
      swap(lx, rx), swap(ly, ry);
    }
    if (lx - ly == rx - ry && lx - ly == sx - sy && lx <= x && x <= rx) cur++;
    if (lx + ly == rx + ry && lx + ly == sx + sy && lx <= x && x <= rx) cur++;
    if (cur > 4) break;
  }
}
int cal(vector<pair<int, int> > &v) {
  for (vector<pair<int, int> >::iterator x = v.begin(); x != v.end(); x++)
    if (x->first > x->second) swap(x->first, x->second);
  sort(v.begin(), v.end());
  int R = -1, L = 0, ans = 0;
  for (vector<pair<int, int> >::iterator x = v.begin(); x != v.end(); x++)
    if (x->first > R) {
      ans += R - L + 1;
      L = x->first;
      R = x->second;
    } else
      R = max(R, x->second);
  return ans + R - L + 1;
}
int main() {
  int nb;
  scanf("%d%d%d", &n, &m, &nb);
  for (int i = 0; i <= n + 1; i++) {
    p1[i].push_back(i);
    p1[i + m + 1].push_back(i);
    p2[i + m + 1].push_back(i);
    p2[i - (m + 1) + m + 1].push_back(i);
  }
  for (int i = 1; i <= m; i++) {
    p1[i].push_back(0);
    p1[n + 1 + i].push_back(n + 1);
    p2[-i + m + 1].push_back(0);
    p2[n + 1 - i + m + 1].push_back(n + 1);
  }
  for (int i = 0; i < nb; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    p1[x + y].push_back(x);
    p2[x - y + m + 1].push_back(x);
  }
  for (int i = 0; i <= n + m + 2; i++) {
    sort(p1[i].begin(), p1[i].end());
    sort(p2[i].begin(), p2[i].end());
  }
  char ch[10];
  int x, y;
  scanf("%d%d%s", &x, &y, ch);
  doit(x, y, ID(ch));
  long long ans = 0;
  for (int i = 0; i <= n + m + 2; i++) ans += cal(a[i]) + cal(b[i]);
  printf("%I64d\n", ans);
  return 0;
}
