#include <bits/stdc++.h>
using namespace std;
int n, m, k, id;
map<pair<int, int>, int> ord;
pair<int, int> loc[5 * 100100];
int _x[] = {-1, -1, 1, 1};
int _y[] = {1, -1, -1, 1};
bool acc[5 * 100100][4];
vector<pair<int, int> > l[2][2 * 100100];
inline int code0(pair<int, int> a) { return a.first + a.second; }
inline int code1(pair<int, int> a) { return a.first + m + 1 - a.second; }
void insert(pair<int, int> a) {
  ord[a] = id;
  loc[id] = a;
  id++;
  l[0][code0(a)].push_back(a);
  l[1][code1(a)].push_back(a);
}
int nxt_dir(int dir, pair<int, int> a) {
  int x = a.first, y = a.second;
  bool l = (ord.find(make_pair(x, y - 1)) == ord.end()) ? false : true,
       r = (ord.find(make_pair(x, y + 1)) == ord.end()) ? false : true,
       u = (ord.find(make_pair(x - 1, y)) == ord.end()) ? false : true,
       d = (ord.find(make_pair(x + 1, y)) == ord.end()) ? false : true;
  if (dir == 0) {
    if (l && d) return 2;
    if (!l && !d) return 2;
    if (l) return 3;
    return 1;
  }
  if (dir == 1) {
    if (r && d) return 3;
    if (!r && !d) return 3;
    if (r) return 2;
    return 0;
  }
  if (dir == 2) {
    if (u && r) return 0;
    if (!u && !r) return 0;
    if (u) return 3;
    return 1;
  }
  if (dir == 3) {
    if (u && l) return 1;
    if (!u && !l) return 1;
    if (u) return 2;
    return 0;
  }
}
map<pair<int, int>, int> route;
inline int less_than(vector<pair<int, int> > &v, pair<int, int> g) {
  int ll = 0, rr = v.size() - 1, mid, t = 0;
  while (ll <= rr) {
    mid = ll + rr >> 1;
    if (v[mid] < g)
      t = mid, ll = mid + 1;
    else
      rr = mid - 1;
  }
  return ord[v[t]];
}
inline int greater_than(vector<pair<int, int> > &v, pair<int, int> g) {
  int ll = 0, rr = v.size() - 1, mid, t = v.size() - 1;
  while (ll <= rr) {
    mid = ll + rr >> 1;
    if (v[mid] >= g)
      t = mid, rr = mid - 1;
    else
      ll = mid + 1;
  }
  return ord[v[t]];
}
inline pair<int, int> nxt_fr(int dir, int ndir, pair<int, int> block) {
  int x = (_x[dir] == _x[ndir]) ? block.first : (block.first + _x[ndir]);
  int y = (_y[dir] == _y[ndir]) ? block.second : (block.second + _y[ndir]);
  return make_pair(x, y);
}
int main() {
  cin >> n >> m >> k;
  for (int i = 0; i <= m + 1; i++)
    insert(make_pair(0, i)), insert(make_pair(n + 1, i));
  for (int i = 1; i <= n; i++)
    insert(make_pair(i, 0)), insert(make_pair(i, m + 1));
  for (int i = 0; i < k; i++) {
    int a, b;
    cin >> a >> b;
    insert(make_pair(a, b));
  }
  for (int i = 0; i < 2 * 100100; i++)
    sort(l[0][i].begin(), l[0][i].end()), sort(l[1][i].begin(), l[1][i].end());
  int dir;
  string _in;
  pair<int, int> fr, block = make_pair(-1, -1);
  cin >> fr.first >> fr.second >> _in;
  if (_in == "NE") dir = 0;
  if (_in == "NW") dir = 1;
  if (_in == "SE") dir = 3;
  if (_in == "SW") dir = 2;
  while (ord.find(block) == ord.end() || acc[ord[block]][dir] == false) {
    if (ord.find(block) != ord.end()) acc[ord[block]][dir] = true;
    pair<int, int> nfr, nblock;
    int ndir;
    int hid, tid;
    if (dir == 0 || dir == 2)
      hid = less_than(l[0][code0(fr)], fr),
      tid = greater_than(l[0][code0(fr)], fr);
    else
      hid = less_than(l[1][code1(fr)], fr),
      tid = greater_than(l[1][code1(fr)], fr);
    if (dir == 2 || dir == 3)
      nblock = loc[tid];
    else
      nblock = loc[hid];
    ndir = nxt_dir(dir, nblock);
    nfr = nxt_fr(dir, ndir, nblock);
    int D;
    pair<int, int> arrt;
    arrt = make_pair(nblock.first - _x[dir], nblock.second - _y[dir]);
    D = abs(arrt.first - fr.first) + 1;
    if (route.find(make_pair(hid, tid)) == route.end()) {
      route[make_pair(hid, tid)] = D;
    } else {
      if (route[make_pair(hid, tid)]) {
        route[make_pair(hid, tid)] = D;
      }
    }
    fr = nfr, dir = ndir, block = nblock;
  }
  long long ans = 0;
  map<pair<int, int>, int>::iterator it = route.begin();
  for (; it != route.end(); it++) {
    ans += (long long)(it->second);
  }
  cout << ans << endl;
}
