/*--------------------------------------------------------------*/
/* ACM ICPC 2009-2010, NEERC                                    */
/* Northern Subregional Contest                                 */
/* St Petersburg, October 17, 2009                              */
/*--------------------------------------------------------------*/
/* Problem C. Circles on a Screen                               */
/*                                                              */
/* Original idea         Georgiy Korneev                        */
/* Problem statement     Oleg Davydov                           */
/* Testset               Oleg Davydov                           */
/*--------------------------------------------------------------*/
/* Solution                                                     */
/*                                                              */
/* Author                Oleg Davydov                           */
/*--------------------------------------------------------------*/
 
#include <cmath>
#include <cstdio>

#include <algorithm>
#include <iostream>
#include <utility>
#include <vector>

using namespace std;

long long dist( long long x1, long long y1, long long x2, long long y2 )
{
  return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
}

int main()
{
  freopen("circles.in", "r", stdin);
  freopen("circles.out", "w", stdout);

  int rx, ry, n;
  cin >> rx >> ry >> n;
  long long *x = new long long[n];
  long long *y = new long long[n];
  long long *r = new long long[n];
  for (int i = 0; i < n; i++)
  {
    cin >> x[i] >> y[i] >> r[i];
    r[i] = r[i] * r[i];
  }

  long long ans = 0;
  for (int cx = 0; cx < rx; cx++)
  {
    vector <pair <int, int> > events;
    for (int i = 0; i < n; i++)
    {
      if (dist(x[i], y[i], cx, y[i]) > r[i])
        continue;
      long long dy = max(0ll, (long long)sqrtl(1.0 * (r[i] - (x[i] - cx) * (x[i] - cx))) - 10);
      while (dist(x[i], y[i], cx, y[i] + dy + 1) <= r[i])
        dy++;
      events.push_back(make_pair(max(y[i] - dy, 0ll), +1));
      events.push_back(make_pair(min(y[i] + dy + 1, (long long)ry), -1));
    }
    sort(events.begin(), events.end());
    int cur = 0, sum = 0, pos = 0;
    for (int i = 0; i < (int)events.size(); i++)
    {
      if (cur != 0)
        sum += (events[i].first - pos);
      pos = events[i].first;
      cur += events[i].second;
    }
    ans += sum;
  }
  cout << (long long)rx * (long long)ry - ans << endl;

  delete x;
  delete y;
  delete r;

  return 0;
}

