#include <bits/stdc++.h>
using namespace std;
const int N = 500010;
const int U = 150000;
const int mo = 100037;
int n, m, k, flag;
set<int> po[N], ne[N];
struct HashMap {
  vector<pair<int, int> > s[mo];
  int operator[](pair<int, int> x) {
    unsigned long long hs = x.first * 700001 + x.second;
    int pos = hs % mo;
    for (int i = 0; i < s[pos].size(); i += 1) {
      if (s[pos][i] == x) return 1;
    }
    return 0;
  }
  void ins(pair<int, int> x) {
    unsigned long long hs = x.first * 700001 + x.second;
    int pos = hs % mo;
    s[pos].push_back(x);
  }
} mp;
struct dir {
  int x, y;
};
void trans(int &x, int &y, dir &d) {
  if (!mp[make_pair((x), (y))]) return;
  int a = mp[make_pair((x - d.x), (y))], b = mp[make_pair((x), (y - d.y))];
  if ((!a && !b) || (a && b)) {
    flag = true;
    x -= d.x;
    y -= d.y;
    d.x = -d.x;
    d.y = -d.y;
  } else if (!a)
    x -= d.x, d.x = -d.x;
  else
    y -= d.y, d.y = -d.y;
}
int go(int &x, int &y, dir &d) {
  int u = x, ret, b;
  set<int>::iterator itr;
  if (!((d.x == 1) ^ (d.y == 1))) {
    b = y - x;
    itr = po[y - x + U].lower_bound(x);
    if (d.x == 1 && *itr == x)
      ++itr;
    else if (d.x == -1)
      --itr;
    x = *itr;
    y = x + b;
    ret = abs(x - u);
  } else {
    b = x + y;
    itr = ne[x + y].lower_bound(x);
    if (d.x == 1 && *itr == x)
      ++itr;
    else if (d.x == -1)
      --itr;
    x = *itr;
    y = -x + b;
    ret = abs(x - u);
  }
  trans(x, y, d);
  return ret;
}
int main() {
  scanf("%d%d%d", &n, &m, &k);
  int x, y;
  for (int i = 0; i <= n + 1; i += 1) {
    po[-i + U].insert(i);
    ne[i].insert(i);
    mp.ins(make_pair((i), (0)));
    po[m + 1 - i + U].insert(i);
    ne[i + m + 1].insert(i);
    mp.ins(make_pair((i), (m + 1)));
  }
  for (int i = 0; i <= m + 1; i += 1) {
    po[i + U].insert(0);
    ne[i].insert(0);
    mp.ins(make_pair((0), (i)));
    po[i - n - 1 + U].insert(n + 1);
    ne[n + 1 + i].insert(n + 1);
    mp.ins(make_pair((n + 1), (i)));
  }
  for (int i = 1; i <= k; i += 1) {
    scanf("%d%d", &x, &y);
    po[y - x + U].insert(x);
    ne[x + y].insert(x);
    mp.ins(make_pair((x), (y)));
  }
  scanf("%d%d", &x, &y);
  po[y - x + U].insert(x);
  ne[x + y].insert(x);
  int u, v, dx, dy;
  dir d;
  char op[5];
  scanf("%s", op);
  if (op[0] == 'N' && op[1] == 'E')
    d = (dir){-1, 1};
  else if (op[0] == 'N' && op[1] == 'W')
    d = (dir){-1, -1};
  else if (op[0] == 'S' && op[1] == 'E')
    d = (dir){1, 1};
  else
    d = (dir){1, -1};
  long long ans = 0;
  u = x;
  v = y;
  dx = d.x;
  dy = d.y;
  do {
    ans += go(u, v, d);
  } while (u != x || v != y || d.x != dx || d.y != dy);
  if (flag) ans >>= 1;
  cout << ans;
  return 0;
}
