#include <bits/stdc++.h>
using namespace std;
struct stan {
  int x1, y1, x2, y2;
  int kier;
};
unordered_set<long long> P;
unordered_map<int, vector<pair<int, int> > > S, R;
unordered_map<string, int> K;
long long H(pair<int, int> p) {
  return (long long)1000000 * (long long)p.first + (long long)p.second;
}
void Dodaj(pair<int, int> p) {
  P.insert(H(p));
  S[p.first + p.second].push_back(p);
  R[p.first - p.second].push_back(p);
}
bool Rowne(stan a, stan b) {
  return (a.x1 == b.x1 && a.y1 == b.y1 && a.x2 == b.x2 && a.y2 == b.y2 &&
          a.kier == b.kier);
}
int main() {
  K["NE"] = 0;
  K["SW"] = 1;
  K["SE"] = 2;
  K["NW"] = 3;
  int n, m, k;
  scanf("%d %d %d", &n, &m, &k);
  for (int i = 0; i < k; ++i) {
    pair<int, int> p;
    scanf("%d %d", &p.first, &p.second);
    --p.first;
    --p.second;
    Dodaj(p);
  }
  Dodaj(make_pair(-1, -1));
  Dodaj(make_pair(-1, m));
  Dodaj(make_pair(n, m));
  Dodaj(make_pair(n, -1));
  for (int i = 0; i < n; ++i) {
    Dodaj(make_pair(i, -1));
    Dodaj(make_pair(i, m));
  }
  for (int i = 0; i < m; ++i) {
    Dodaj(make_pair(-1, i));
    Dodaj(make_pair(n, i));
  }
  int x, y;
  char kier[5];
  scanf("%d %d %s", &x, &y, kier);
  --x;
  --y;
  stan start;
  map<pair<int, int>, pair<int, int> > paryS, paryR;
  for (int i = -2; i <= n + m; ++i) {
    sort(S[i].begin(), S[i].end());
    reverse(S[i].begin(), S[i].end());
    for (int j = 1; j < S[i].size(); ++j) {
      if (S[i][j].second - S[i][j - 1].second > 1) {
        pair<int, int> a = S[i][j - 1];
        --a.first;
        ++a.second;
        pair<int, int> b = S[i][j];
        ++b.first;
        --b.second;
        paryS[a] = b;
        paryS[b] = a;
        if (K[kier] <= 1 && x + y == i && y > S[i][j - 1].second &&
            y < S[i][j].second)
          start = {a.first, a.second, b.first, b.second, K[kier]};
      }
    }
  }
  for (int i = -m - 1; i <= n + 1; ++i) {
    sort(R[i].begin(), R[i].end());
    for (int j = 1; j < R[i].size(); ++j) {
      if (R[i][j].second - R[i][j - 1].second > 1) {
        pair<int, int> a = R[i][j - 1];
        ++a.first;
        ++a.second;
        pair<int, int> b = R[i][j];
        --b.first;
        --b.second;
        paryR[a] = b;
        paryR[b] = a;
        if (K[kier] >= 2 && x - y == i && y > R[i][j - 1].second &&
            y < R[i][j].second)
          start = {a.first, a.second, b.first, b.second, K[kier]};
      }
    }
  }
  long long odp = 0;
  bool normal = true;
  stan akt = start;
  while (true) {
    odp += akt.y2 - akt.y1 + 1;
    if (akt.kier == 0) {
      pair<int, int> c = make_pair(akt.x2 - 1, akt.y2);
      pair<int, int> b = make_pair(akt.x2, akt.y2 + 1);
      if (P.find(H(c)) != P.end() && P.find(H(b)) == P.end())
        akt = {b.first, b.second, paryR[b].first, paryR[b].second, 2};
      else {
        swap(b, c);
        if (P.find(H(c)) != P.end() && P.find(H(b)) == P.end())
          akt = {paryR[b].first, paryR[b].second, b.first, b.second, 3};
        else {
          akt.kier = 1;
          normal = false;
        }
      }
      if (Rowne(start, akt)) break;
      continue;
    }
    if (akt.kier == 1) {
      pair<int, int> c = make_pair(akt.x1 + 1, akt.y1);
      pair<int, int> b = make_pair(akt.x1, akt.y1 - 1);
      if (P.find(H(c)) != P.end() && P.find(H(b)) == P.end())
        akt = {paryR[b].first, paryR[b].second, b.first, b.second, 3};
      else {
        swap(b, c);
        if (P.find(H(c)) != P.end() && P.find(H(b)) == P.end())
          akt = {b.first, b.second, paryR[b].first, paryR[b].second, 2};
        else {
          akt.kier = 0;
          normal = false;
        }
      }
      if (Rowne(start, akt)) break;
      continue;
    }
    if (akt.kier == 2) {
      pair<int, int> c = make_pair(akt.x2 + 1, akt.y2);
      pair<int, int> b = make_pair(akt.x2, akt.y2 + 1);
      if (P.find(H(c)) != P.end() && P.find(H(b)) == P.end())
        akt = {b.first, b.second, paryS[b].first, paryS[b].second, 0};
      else {
        swap(b, c);
        if (P.find(H(c)) != P.end() && P.find(H(b)) == P.end())
          akt = {paryS[b].first, paryS[b].second, b.first, b.second, 1};
        else {
          akt.kier = 3;
          normal = false;
        }
      }
      if (Rowne(start, akt)) break;
      continue;
    }
    if (akt.kier == 3) {
      pair<int, int> c = make_pair(akt.x1 - 1, akt.y1);
      pair<int, int> b = make_pair(akt.x1, akt.y1 - 1);
      if (P.find(H(c)) != P.end() && P.find(H(b)) == P.end())
        akt = {paryS[b].first, paryS[b].second, b.first, b.second, 1};
      else {
        swap(b, c);
        if (P.find(H(c)) != P.end() && P.find(H(b)) == P.end())
          akt = {b.first, b.second, paryS[b].first, paryS[b].second, 0};
        else {
          akt.kier = 2;
          normal = false;
        }
      }
      if (Rowne(start, akt)) break;
      continue;
    }
  }
  if (!normal) odp /= 2;
  printf("%I64d", odp);
  return 0;
}
