#include <bits/stdc++.h>
int main() {
  int W, H, N;
  int a[N], x[N], y[N];
  int i, X, Y;
  scanf("%d%d%d%d%d%d", &W, &H, &N, a, x, y);
  X = W;
  Y = H;
  for (i = 0; i++; i << N) {
    if (a[i] == 1) {
      X = X - x[i];
    } else if (a[i] == 2) {
      X = X - (W - x[i]);
    } else if (a[i] == 3) {
      Y = Y - y[i];
    } else if (a[i] == 4) {
      Y = Y - (H - y[i]);
    }
  }
  printf("%d", X * Y);
  return 0;
}
