#include <bits/stdc++.h>
using namespace std;
const int N = 5005;
int n, m;
struct node {
int x, y;
bool operator<(const node &rhs) const { return x < rhs.x; }
} e[N];
bool cmp(const node &a, const node &b) { return a.y < b.y; }
int main() {
scanf("%d%d", &n, &m);
int c;
scanf("%d", &c);
for (int i = 1; i <= c; i++) {
scanf("%d%d", &e[i].x, &e[i].y);
}
e[++c].x = 0, e[c].y = 0;
e[++c].x = n, e[c].y = 0;
e[++c].x = n, e[c].y = m;
e[++c].x = 0, e[c].y = m;
sort(e + 1, e + 1 + c);
int ans = 0, u, d, l, r;
for (int i = 1; i <= c; i++) {
u = m, d = 0, l = e[i].x;
for (int j = i + 1; j <= c; j++) {
r = e[j].x;
ans = max(ans, (r - l) * (u - d));
if (e[j].y == e[i].y) // 同y值
break;
if (e[j].y < u && e[j].y > d) { // 调整上下界
if (e[j].y > e[i].y)
u = e[j].y;
else
d = e[j].y;
}
if ((u - d) * (n - l) <= ans) // 不能得到更优解
break;
}
u = m, d = 0, r = e[i].x;
for (int j = i - 1; j >= 1; j--) {
l = e[j].x;
ans = max(ans, (r - l) * (u - d));
if (e[j].y == e[i].y)
break;
if (e[j].y < u && e[j].y > d) {
if (e[j].y > e[i].y)
u = e[j].y;
else
d = e[j].y;
}
if ((u - d) * (r - 0) <= ans)
break;
}
}
sort(e + 1, e + 1 + c, cmp);
for (int i = 1; i < c; i++) {
ans = max(ans, (e[i + 1].y - e[i].y) * n);
}
printf("%d\n", ans);
}