#include <bits/stdc++.h>
using namespace std;
long long int cuenta(map<int, int> v[500000], int tope) {
  long long int c = 0;
  for (int i = 0; i < tope; i++) {
    map<int, int> &m = v[i];
    map<int, int>::iterator it = m.begin();
    if (it != m.end()) {
      int pos = it->first;
      it++;
      while (it != m.end()) {
        int nextpos = it->first;
        if (it->second) c += (nextpos - pos - 1) / 2;
        pos = nextpos;
        it++;
      }
    }
  }
  return c;
}
map<int, int> colmas[500000], colmenos[500000], filmas[500000],
    filmenos[500000];
set<pair<int, int> > todos;
void simular(int i, int j, int d) {
  for (;;) {
    if (d == 0) {
      map<int, int>::iterator it = filmas[i].upper_bound(j);
      if (it->second) return;
      it->second = 1;
      j = (it->first) - 1;
      if (todos.count(pair<int, int>(i - 1, j))) {
        if (todos.count(pair<int, int>(i + 1, j))) return;
        colmenos[j][i - 1] = 1;
        d = 3;
      } else if (todos.count(pair<int, int>(i + 1, j))) {
        colmas[j][i + 1] = 1;
        d = 1;
      } else
        return;
    } else if (d == 1) {
      map<int, int>::iterator it = colmenos[j].upper_bound(i);
      it--;
      if (it->second) return;
      it->second = 1;
      i = (it->first) + 1;
      if (todos.count(pair<int, int>(i, j - 1))) {
        if (todos.count(pair<int, int>(i, j + 1))) return;
        filmenos[i][j - 1] = 1;
        d = 0;
      } else if (todos.count(pair<int, int>(i, j + 1))) {
        filmas[i][j + 1] = 1;
        d = 2;
      } else
        return;
    } else if (d == 2) {
      map<int, int>::iterator it = filmenos[i].upper_bound(j);
      it--;
      if (it->second) return;
      it->second = 1;
      j = (it->first) + 1;
      if (todos.count(pair<int, int>(i - 1, j))) {
        if (todos.count(pair<int, int>(i + 1, j))) return;
        colmenos[j][i - 1] = 1;
        d = 3;
      } else if (todos.count(pair<int, int>(i + 1, j))) {
        colmas[j][i + 1] = 1;
        d = 1;
      } else
        return;
    } else if (d == 3) {
      map<int, int>::iterator it = colmas[j].upper_bound(i);
      if (it->second) return;
      it->second = 1;
      i = (it->first) - 1;
      if (todos.count(pair<int, int>(i, j - 1))) {
        if (todos.count(pair<int, int>(i, j + 1))) return;
        filmenos[i][j - 1] = 1;
        d = 0;
      } else if (todos.count(pair<int, int>(i, j + 1))) {
        filmas[i][j + 1] = 1;
        d = 2;
      } else
        return;
    }
  }
}
int n, m, k;
void cambio(int i, int j, int &ii, int &jj) {
  ii = i + j;
  jj = i - j + m + 1;
}
void insert(int i, int j) {
  int ii, jj;
  cambio(i, j, ii, jj);
  todos.insert(pair<int, int>(ii, jj));
  colmenos[jj][ii];
  colmas[jj][ii];
  filmenos[ii][jj];
  filmas[ii][jj];
}
int primero = 1 << 19;
const int tope = 1 << 20;
int cuantos[tope];
void insertar(int pos, int val) {
  pos += primero;
  cuantos[pos] = val;
  while (pos > 1) {
    pos /= 2;
    cuantos[pos] = cuantos[2 * pos] + cuantos[2 * pos + 1];
  }
}
int cuantosentre(int inf, int sup) {
  inf += primero;
  sup += primero;
  if (inf > sup) return 0;
  if (inf == sup) return cuantos[inf];
  int c = cuantos[inf] + cuantos[sup];
  while (inf + 1 < sup) {
    if (inf % 2 == 0) c += cuantos[inf + 1];
    inf /= 2;
    if (sup % 2 == 1) c += cuantos[sup - 1];
    sup /= 2;
  }
  return c;
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> m >> k;
  for (int i = 0; i <= n + 1; i++) {
    insert(i, 0);
    insert(i, m + 1);
  }
  for (int j = 0; j <= m + 1; j++) {
    insert(0, j);
    insert(n + 1, j);
  }
  for (int d = 0; d < k; d++) {
    int i, j;
    cin >> i >> j;
    insert(i, j);
  }
  int ii, jj;
  string dir;
  cin >> ii >> jj >> dir;
  int i, j;
  cambio(ii, jj, i, j);
  if (dir == "NE" or dir == "SW") {
    simular(i, j, 0);
    simular(i, j, 2);
  } else {
    simular(i, j, 1);
    simular(i, j, 3);
  }
  long long int sol =
      cuenta(filmas, n + 1 + m + 1 + 1) + cuenta(colmas, n + 1 + m + 1 + 1);
  map<int, vector<int> > poner, quitar;
  for (int j = 0; j < n + 1 + m + 1 + 1; j++) {
    map<int, int> &mapa = colmas[j];
    map<int, int>::iterator it = mapa.begin();
    if (it != mapa.end()) {
      int pos = it->first;
      it++;
      while (it != mapa.end()) {
        int nextpos = it->first;
        if (it->second) {
          poner[pos + 2].push_back(j);
          quitar[nextpos - 2].push_back(j);
        }
        pos = nextpos;
        it++;
      }
    }
  }
  for (int i = 0; i < n + 1 + m + 1 + 1; i++) {
    vector<int> &po = poner[i];
    for (int jj = 0; jj < int(po.size()); jj++) insertar(po[jj], 1);
    map<int, int> &mapa = filmas[i];
    map<int, int>::iterator it = mapa.begin();
    if (it != mapa.end()) {
      int pos = it->first;
      it++;
      while (it != mapa.end()) {
        int nextpos = it->first;
        if (it->second) sol -= cuantosentre(pos + 2, nextpos - 2);
        pos = nextpos;
        it++;
      }
    }
    vector<int> &qi = poner[i];
    for (int jj = 0; jj < int(qi.size()); jj++) insertar(qi[jj], 0);
  }
  cout << sol << endl;
}
