#include <bits/stdc++.h>
using namespace std;
bool debug = false;
int n, m, k;
int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0};
long long ln, lk, lm;
vector<int> a[200105], b[200105];
int x[200105], y[200105], xs, ys;
set<pair<int, int>> bs;
string ope;
string os[4] = {"NE", "NW", "SE", "SW"};
void add(int x, int y) {
  a[x + y].push_back(y - x);
  b[x - y + m].push_back(x + y);
  bs.insert({x, y});
}
int rf(int &xx, int &yy, int &d) {
  int ty, tx, tmp = xx;
  if (d == 0) {
    int num = xx + yy;
    int tar = *upper_bound(a[num].begin(), a[num].end(), yy - xx);
    ty = (num + tar) / 2;
    tx = (num - tar) / 2;
    bool l = bs.count({tx, ty - 1}), r = bs.count({tx + 1, ty});
    if (l == r) {
      d = 3;
      xx = tx + 1;
      yy = ty - 1;
    } else if (l) {
      d = 2;
      xx = tx + 1;
      yy = ty;
    } else {
      d = 1;
      xx = tx;
      yy = ty - 1;
    }
  } else if (d == 3) {
    int num = xx + yy;
    auto it = upper_bound(a[num].begin(), a[num].end(), yy - xx);
    it--;
    int tar = *it;
    ty = (num + tar) / 2;
    tx = (num - tar) / 2;
    ;
    bool l = bs.count({tx - 1, ty}), r = bs.count({tx, ty + 1});
    if (l == r) {
      d = 0;
      xx = tx - 1;
      yy = ty + 1;
    } else if (l) {
      d = 2;
      xx = tx;
      yy = ty + 1;
    } else {
      d = 1;
      xx = tx - 1;
      yy = ty;
    }
  } else if (d == 1) {
    int num = xx - yy + m;
    auto it = upper_bound(b[num].begin(), b[num].end(), xx + yy);
    it--;
    int tar = *it;
    tx = (num + tar - m) / 2;
    ty = (tar - num + m) / 2;
    bool l = bs.count({tx + 1, ty}), r = bs.count({tx, ty + 1});
    if (l == r) {
      d = 2;
      xx = tx + 1;
      yy = ty + 1;
    } else if (l) {
      d = 0;
      xx = tx;
      yy = ty + 1;
    } else {
      d = 3;
      xx = tx + 1;
      yy = ty;
    }
  } else if (d == 2) {
    int num = xx - yy + m;
    auto it = upper_bound(b[num].begin(), b[num].end(), xx + yy);
    int tar = *it;
    tx = (num + tar - m) / 2;
    ty = (tar - num + m) / 2;
    bool l = bs.count({tx, ty - 1}), r = bs.count({tx - 1, ty});
    if (l == r) {
      d = 1;
      xx = tx - 1;
      yy = ty - 1;
    } else if (l) {
      d = 0;
      xx = tx - 1;
      yy = ty;
    } else {
      d = 3;
      xx = tx;
      yy = ty - 1;
    }
  }
  return abs(tx - tmp);
}
long long ans;
void cal(int d) {
  int tx = xs, ty = ys, td = d, tmx, tmy, tmd;
  while (1) {
    tmx = tx;
    tmy = ty;
    tmd = td;
    ans += rf(tx, ty, td);
    if (tx == xs && ty == ys && d == td) return;
    if (td + tmd == 3) break;
  }
  tx = xs;
  ty = ys;
  td = 3 - d;
  while (1) {
    tmx = tx;
    tmy = ty;
    tmd = td;
    ans += rf(tx, ty, td);
    if (td + tmd == 3) break;
  }
  ans--;
}
int main() {
  scanf("%d%d%d", &n, &m, &k);
  m++;
  n++;
  for (int(i) = 0; (i) < (int)(k); (i)++) {
    scanf("%d%d", x + i, y + i);
    add(x[i], y[i]);
  }
  for (int(i) = 0; (i) < (int)(m + 1); (i)++) {
    add(0, i);
    add(n, i);
  }
  for (int i = 1; i < n; i++) {
    add(i, 0);
    add(i, m);
  }
  for (int(i) = 0; (i) < (int)(m + n + 1); (i)++) {
    sort(a[i].begin(), a[i].end());
    sort(b[i].begin(), b[i].end());
  }
  scanf("%d%d", &xs, &ys);
  cin >> ope;
  int d;
  for (d = 0; d < 4; d++)
    if (os[d] == ope) break;
  rf(xs, ys, d);
  cal(d);
  printf("%lld\n", ans);
}
