#include <stdio.h>
#define infile "bigbrn.in"
#define outfile "bigbrn.out"
#define maxn 1010
struct Tstack{
long v,j;
}df[maxn+1];
char a[maxn+1][maxn+1];
long h[maxn+1],
n,m,dftop=0,result=0;
//FILE *fin=fopen(infile,"r"),
//*fout=fopen(outfile,"w");
void init()
{
long i,j,ge,x,y;
FILE *fin=fopen(infile,"r");
fscanf(fin,"%ld%ld%ld",&m,&n,&ge);
for (i=1; i<=n; i++)
for (j=1; j<=n; j++)
a[i][j]=0;
for (i=1; i<=ge; i++)
{
fscanf(fin,"%ld%ld",&x,&y);
a[x][y]=1;
}
fclose(fin);
}
void work()
{
long x,i,t;
for (i=1; i<=n; i++)
h[i]=0;
result=0;
for (x=1; x<=m; x++)
{
for (i=1; i<=n; i++)
if (!a[x][i])
h[i]++;
else h[i]=0;
h[n+1]=-1; //special
dftop=0;
for (i=1; i<=n+1; i++)
{
if ((!dftop)||(h[i]>df[dftop].v))
{
df[++dftop].v=h[i];
df[dftop].j=i;
continue;
}
if (h[i]==df[dftop].v)
continue;
while ((dftop)&&(h[i]<df[dftop].v))
{
t=df[dftop].v*(i-df[dftop].j);
if (t>result)
result=t;
dftop--;
}
if ((dftop)&&(h[i]==df[dftop].v))
continue;
dftop++;
df[dftop].v=h[i];
}
}
}
void output()
{
FILE*fout=fopen(outfile,"w");
fprintf(fout,"%ld\n",result);
printf("%ld\n",result);
fclose(fout);
}
int main()
{
init();
work();
output();
return 0;
}