#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
struct point {
  int r, c;
};
struct line {
  point inc, ref;
  int incD, refD;
};
struct pcom {
  bool operator()(const point &a, const point &b) const {
    if (a.r < b.r) return true;
    if (a.r > b.r) return false;
    return a.c < b.c;
  }
};
struct lcom {
  bool operator()(const line &a, const line &b) const {
    if (a.incD < b.incD) return true;
    if (a.incD > b.incD) return false;
    if (a.incD == 0) {
      if (a.inc.r + a.inc.c < b.inc.r + b.inc.c) return true;
      if (a.inc.r + a.inc.c > b.inc.r + b.inc.c) return false;
      return a.inc.c < b.inc.c;
    }
    if (a.incD == 1) {
      if (a.inc.r - a.inc.c < b.inc.r - b.inc.c) return true;
      if (a.inc.r - a.inc.c > b.inc.r - b.inc.c) return false;
      return a.inc.c > b.inc.c;
    }
    if (a.incD == 2) {
      if (a.inc.r - a.inc.c < b.inc.r - b.inc.c) return true;
      if (a.inc.r - a.inc.c > b.inc.r - b.inc.c) return false;
      return a.inc.c < b.inc.c;
    }
    if (a.incD == 3) {
      if (a.inc.r + a.inc.c < b.inc.r + b.inc.c) return true;
      if (a.inc.r + a.inc.c > b.inc.r + b.inc.c) return false;
      return a.inc.c > b.inc.c;
    }
    return true;
  }
};
int ml(line tem, int n) {
  int res;
  if (tem.incD == 1 || tem.incD == 2) {
    res = n - 1 - tem.inc.r + tem.inc.c;
  } else {
    res = tem.inc.r + tem.inc.c - 2;
  }
  return res;
}
void myinsert(deque<deque<bool> > &occ, int oa, int ob,
              vector<vector<set<line, lcom> > > &lin, point &itt, int da,
              int db, int dc, int n) {
  if (!occ[oa][ob]) {
    if (occ[1][ob] && !occ[oa][1]) {
      line tem;
      tem.inc.r = tem.ref.r = itt.r + oa - 1;
      tem.inc.c = itt.c + ob - 1;
      tem.incD = da;
      tem.ref.c = itt.c;
      tem.refD = db;
      lin[da][ml(tem, n)].insert(tem);
    } else if (!occ[1][ob] && occ[oa][1]) {
      line tem;
      tem.inc.c = tem.ref.c = itt.c + ob - 1;
      tem.inc.r = itt.r + oa - 1;
      tem.incD = da;
      tem.ref.r = itt.r;
      tem.refD = dc;
      lin[da][ml(tem, n)].insert(tem);
    } else {
      line tem;
      tem.inc.c = tem.ref.c = itt.c + ob - 1;
      tem.inc.r = tem.ref.r = itt.r + oa - 1;
      tem.incD = da;
      tem.refD = 3 - da;
      lin[da][ml(tem, n)].insert(tem);
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  int n, m, k;
  cin >> n >> m >> k;
  set<point, pcom> bc;
  for (long long i = 0; i < n + 2; ++i) {
    point p;
    p.r = i;
    p.c = 0;
    bc.insert(p);
    p.c = m + 1;
    bc.insert(p);
  }
  for (long long i = 0; i < m + 2; ++i) {
    point p;
    p.r = 0;
    p.c = i;
    bc.insert(p);
    p.r = n + 1;
    bc.insert(p);
  }
  for (long long i = 0; i < k; ++i) {
    point p;
    cin >> p.r >> p.c;
    bc.insert(p);
  }
  line start;
  string s;
  cin >> start.inc.r >> start.inc.c >> s;
  if (s == "NE") start.incD = 0;
  if (s == "NW") start.incD = 1;
  if (s == "SE") start.incD = 2;
  if (s == "SW") start.incD = 3;
  vector<vector<set<line, lcom> > > lin(
      4, vector<set<line, lcom> >(n + m - 1, set<line, lcom>()));
  for (set<point, pcom>::iterator it = bc.begin(); it != bc.end(); ++it) {
    point itt = *it;
    deque<deque<bool> > occ(3, deque<bool>(3, false));
    for (long long i = 0; i < 3; ++i)
      for (long long j = 0; j < 3; ++j) {
        point tem = *it;
        tem.r += i - 1;
        tem.c += j - 1;
        if (tem.r < 0 || tem.r > n + 1 || tem.c < 0 || tem.c > m + 1 ||
            bc.count(tem))
          occ[i][j] = true;
      }
    myinsert(occ, 0, 0, lin, itt, 2, 0, 3, n);
    myinsert(occ, 0, 2, lin, itt, 3, 1, 2, n);
    myinsert(occ, 2, 2, lin, itt, 1, 3, 0, n);
    myinsert(occ, 2, 0, lin, itt, 0, 2, 1, n);
  }
  set<line, lcom>::iterator it =
      lin[start.incD][ml(start, n)].lower_bound(start);
  line pos = *it, spos = *it;
  vector<vector<pair<int, int> > > rd(n + m - 1), ru(n + m - 1);
  bool aga = false, single = false;
  long long res = 0;
  while (!aga || (pos.inc.r != spos.inc.r || pos.inc.c != spos.inc.c ||
                  pos.incD != spos.incD)) {
    aga = true;
    if (pos.incD + pos.refD == 3) {
      single = true;
      break;
    }
    line tem;
    tem.inc.r = pos.ref.r;
    tem.inc.c = pos.ref.c;
    tem.incD = pos.refD;
    it = lin[tem.incD][ml(tem, n)].lower_bound(tem);
    pos = *it;
    res += abs(pos.inc.r - tem.inc.r) + 1;
  }
  if (single) {
    pos = spos;
    pos.ref.r = pos.inc.r;
    pos.ref.c = pos.inc.c;
    pos.refD = 3 - pos.incD;
    aga = false;
    while (!aga || pos.incD + pos.refD != 3) {
      aga = true;
      line tem;
      tem.inc.r = pos.ref.r;
      tem.inc.c = pos.ref.c;
      tem.incD = pos.refD;
      it = lin[tem.incD][ml(tem, n)].lower_bound(tem);
      pos = *it;
      res += abs(pos.inc.r - tem.inc.r) + 1;
    }
  }
  cout << res << endl;
  return 0;
}
