#include<bits/stdc++.h>

using namespace std;

#define REP(i,n) for(ll (i) = 0;(i) < (n);i++)
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define FI first
#define SE second
#define ALL(v) b.begin(),v.end()
#define SHOW1d(v, n) {REP(WW,n)cerr<<v[WW]<<" ";cerr<<endl;}
#define SHOW2d(v,WW,HH) {REP(W_,WW){REP(H_,HH)cerr<<v[W_][H_]<<" ";cerr<<endl;}cerr<<endl;}
#define INF 1000000000
#define LLINF 1000000000000000000LL
#define MOD 1000000007

typedef long long ll;
typedef pair<ll, ll> P;

ll mp[55][55];
bool used[55][55];
int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};

void bfs(ll x, ll y, ll z){
  REP(ii, 55)REP(jj, 55)used[ii][jj] = false;
  queue<pair<P, ll>> q;
  q.push(MP(MP(x, y), z));

  while(!q.empty()){
    ll nx = q.front().FI.FI;
    ll ny = q.front().FI.SE;
    ll nz = q.front().SE;
    q.pop();
    if(used[nx][ny])continue;
    used[nx][ny] = true;
    mp[nx][ny] = max(mp[nx][ny], nz);

    REP(i, 4){
      ll xx = nx + dx[i];
      ll yy = ny + dy[i];
      if(xx < 0 || yy < 0 || xx >= 55 | yy >= 55)continue;
      if(used[xx][yy])continue;
      q.push(MP(MP(xx, yy), nz - 1));
    }
  }
}

int main() {
  cin.tie(0);cout.tie(0);ios::sync_with_stdio(false);
  REP(i, 55)REP(j, 55)mp[i][j] = -INF;

  ll w, h, n;cin >> w >> h >> n;
  vector<pair<P, ll>> v;

  REP(i, n){
    ll x, y, z;cin >> x >> y >> z;
    v.EB(MP(x, y), z);
    bfs(x, y, z);
  }

  //SHOW2d(mp, 15, 15);

  REP(i, n){
    ll x = v[i].FI.FI;
    ll y = v[i].FI.SE;
    ll z = v[i].SE;
    if(mp[x][y] != z){
      cout << "No" << endl;
      return 0;
    }
  }

  ll ans = 0;
  REP(i, w)REP(j, h)ans += mp[i+1][j+1];
  cout << ans << endl;

  return 0;
}

