#include<bits/stdc++.h>
#include<iostream>
 
 
using namespace std;
void build();
#define ll              long long
#define ULL             unsigned long long
#define ff              first
#define ss              second
#define pb              push_back
#define PI              acos(-1.0)
#define mk              make_pair
#define pii             pair<int,int>
#define pll             pair<LL,LL>
#define min3(a,b,c)     min(a,min(b,c))
#define max3(a,b,c)     max(a,max(b,c))
#define min4(a,b,c,d)   min(a,min(b,min(c,d)))
#define max4(a,b,c,d)   max(a,max(b,max(c,d)))
#define SQR(a)          ((a)*(a))
#define f(i,a,b)      for(int i=a;i<=b;i++)
#define rf(i,a,b)      for(int i=a;i>=b;i--)
#define fr(i,b)        for(int i=0;i<b;i++)
#define MEM(a,x)        memset(a,x,sizeof(a))
#define ABS(x)          ((x)<0?-(x):(x))
#define all(v)          v.begin(),v.end()
#define srt(v)         sort(v.begin(),v.end())
#define rv(v)          reverse(v.begin(),v.end())
#define mx             100005


void solve(){
	int n,k;
	cin>>n>>k;
	int sum=0;
	for(int i=1;i<=n;i++){
		//int t=1;
		for(int j=1;j<=k;j++){
			int tm=i*100+j;
			sum+=tm;
		}
	}
	cout<<sum<<endl;
}
int main(){
	#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
    int t=1;
    //cin>>t;
    while(t--){
    	solve();
    }
    return 0;
}
#include<bits/stdc++.h>
using namespace std;
inline int read(){
	int res=0;
	bool zf=0;
	char c;
	while(((c=getchar())<'0'||c>'9')&&c!='-');
	if(c=='-')zf=1;
	else res=c-'0';
	while((c=getchar())>='0'&&c<='9')res=(res<<3)+(res<<1)+c-'0';
	if(zf)return -res;
	return res;
}
const int maxn=2e5+5,N=2e5;
int p[maxn],q[maxn];
struct op{
	int id,val;
}r[maxn];
inline int cmp(op x,op y){
	return x.val>y.val;
}
int s[maxn];
inline void add(int x){
	for(;x<=N;++s[x],x+=x&-x);
	return;
}
inline int query(int x,int A=0){
	for(;x;A+=s[x],x-=x&-x);
	return A;
}
signed main(){
	int h=read(),w=read(),m=read();
	for(register int i=1;i<=h;++i){
		p[i]=w;
	}
	for(register int i=1;i<=w;++i){
		q[i]=h;
	}
	int m1=h,m2=w;
	while(m--){
		int x=read(),y=read();
		p[x]=min(p[x],y-1),q[y]=min(q[y],x-1);
		if(x==1){
			m2=min(m2,y-1);
		}
		if(y==1){
			m1=min(m1,x-1);
		}
	}
	long long A=0;
	for(register int i=1;i<=m1;++i){
		A+=p[i];
	}
	for(register int i=1;i<=m2;++i){
		A+=q[i];
	}
	for(register int i=1;i<=m2;++i){
		r[i].id=i,r[i].val=q[i];
	}
	sort(r+1,r+m2+1,cmp);
	int now=1;
	for(register int i=m1;i>=1;--i){
		while(now<=m2&&r[now].val>=i){
			add(r[now].id);
			++now;
		}
		A-=query(p[i]);
	}
	printf("%lld\n",A);
	return 0;
}