#include <bits/stdc++.h>
const int N = 100100;
using namespace std;
int n;
int m;
int k;
set<pair<int, int> > X;
set<int> A[N * 2];
set<int> B[N * 2];
vector<pair<int, int> > Q1[N * 2];
vector<pair<int, int> > Q2[N * 2];
int dx[4] = {-1, 1, 1, -1};
int dy[4] = {1, 1, -1, -1};
int block(int x, int y) { return X.find({x, y}) != X.end(); }
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> m >> k;
  for (int i = 1; i <= k; i++) {
    int x, y;
    cin >> x >> y;
    X.insert({x, y});
  }
  for (int i = 0; i <= m + 1; i++) {
    X.insert({0, i});
    X.insert({n + 1, i});
  }
  for (int i = 0; i <= n + 1; i++) {
    X.insert({i, 0});
    X.insert({i, m + 1});
  }
  for (auto p : X) {
    A[p.first + p.second].insert(p.first);
    B[p.first - p.second + N].insert(p.first);
  }
  int x, y, t;
  string s;
  cin >> x >> y >> s;
  if (s == "NE") {
    t = 0;
  } else if (s == "NW") {
    t = 3;
  } else if (s == "SE") {
    t = 1;
  } else {
    t = 2;
  }
  set<pair<pair<int, int>, int> > used;
  while (used.find({{x, y}, t}) == used.end()) {
    used.insert({{x, y}, t});
    if (t == 0) {
      auto p = A[x + y].lower_bound(x);
      p--;
      int nx = *p - dx[t], ny = (x + y - *p) - dy[t];
      Q1[x + y].push_back({min(x, nx), 1});
      Q1[x + y].push_back({max(x, nx) + 1, -1});
      x = nx, y = ny;
      if (block(x + dx[t], y) && block(x, y + dy[t]) ||
          !block(x + dx[t], y) && !block(x, y + dy[t])) {
        t = (t + 2) % 4;
      } else if (block(x + dx[t], y)) {
        y += dy[t];
        t = 1;
      } else if (block(x, y + dy[t])) {
        x += dx[t];
        t = 3;
      }
    } else if (t == 2) {
      auto p = A[x + y].lower_bound(x);
      int nx = *p - dx[t], ny = (x + y - *p) - dy[t];
      Q1[x + y].push_back({min(x, nx), 1});
      Q1[x + y].push_back({max(x, nx) + 1, -1});
      x = nx, y = ny;
      if (block(x + dx[t], y) && block(x, y + dy[t]) ||
          !block(x + dx[t], y) && !block(x, y + dy[t])) {
        t = (t + 2) % 4;
      } else if (block(x + dx[t], y)) {
        y += dy[t];
        t = 3;
      } else if (block(x, y + dy[t])) {
        x += dx[t];
        t = 1;
      }
    } else if (t == 1) {
      auto p = B[x - y + N].lower_bound(x);
      int nx = *p - dx[t], ny = (y - x + *p) - dy[t];
      Q2[x - y + N].push_back({min(x, nx), 1});
      Q2[x - y + N].push_back({max(x, nx) + 1, -1});
      x = nx, y = ny;
      if (block(x + dx[t], y) && block(x, y + dy[t]) ||
          !block(x + dx[t], y) && !block(x, y + dy[t])) {
        t = (t + 2) % 4;
      } else if (block(x + dx[t], y)) {
        y += dy[t];
        t = 0;
      } else if (block(x, y + dy[t])) {
        x += dx[t];
        t = 2;
      }
    } else {
      auto p = B[x - y + N].lower_bound(x);
      p--;
      int nx = *p - dx[t], ny = (y - x + *p) - dy[t];
      Q2[x - y + N].push_back({min(x, nx), 1});
      Q2[x - y + N].push_back({max(x, nx) + 1, -1});
      x = nx, y = ny;
      if (block(x + dx[t], y) && block(x, y + dy[t]) ||
          !block(x + dx[t], y) && !block(x, y + dy[t])) {
        t = (t + 2) % 4;
      } else if (block(x + dx[t], y)) {
        y += dy[t];
        t = 2;
      } else if (block(x, y + dy[t])) {
        x += dx[t];
        t = 0;
      }
    }
  }
  long long res = 0;
  for (int i = 0; i < 2 * N; i++) {
    sort(Q1[i].begin(), Q1[i].end());
    sort(Q2[i].begin(), Q2[i].end());
    for (int j = 0, bal = 0; j < Q1[i].size(); j++) {
      if (bal > 0) {
        res += Q1[i][j].first - Q1[i][j - 1].first;
      }
      bal += Q1[i][j].second;
    }
    for (int j = 0, bal = 0; j < Q2[i].size(); j++) {
      if (bal > 0) {
        res += Q2[i][j].first - Q2[i][j - 1].first;
      }
      bal += Q2[i][j].second;
    }
  }
  cout << res << "\n";
}
