/*--------------------------------------------------------------*/
/* 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                Andrew Stankevich                      */
/*--------------------------------------------------------------*/
 
import java.util.*;
import java.io.*;
import static java.lang.Math.*;

class circles_as implements Runnable {
    final static double EPS = 1e-9;

    public void solve() throws IOException {
        Scanner in = new Scanner(new File("circles.in"));
        PrintWriter out = new PrintWriter(new File("circles.out"));

        int w = in.nextInt();
        int h = in.nextInt();
        int n = in.nextInt();
        int[] x = new int[n];
        int[] y = new int[n];
        int[] r = new int[n];

        for (int i = 0; i < n; i++) {
            x[i] = in.nextInt();
            y[i] = in.nextInt();
            r[i] = in.nextInt();
        }

        int ans = 0;
        int[] e = new int[2 * n];
        for (int i = 0; i < h; i++) {
            int m = 0;
            for (int j = 0; j < n; j++) {
                int dy = abs(y[j] - i);
                if (dy <= r[j]) {
                    int dx = (int) Math.floor(sqrt(r[j] * r[j] - dy * dy) + EPS);
                    e[m] = max(0, (x[j] - dx)) * 2;
                    e[m + 1] = min((x[j] + dx), w - 1) * 2 + 1;
                    m += 2;
                }
            }
            Arrays.sort(e, 0, m);
            int c = 0;
            int last = 0;
            for (int j = 0; j < m; j++) {
                int cur = e[j] / 2;
                if (e[j] % 2 == 0) {
                    c++;
                    if (c == 1) {
                        last = cur;
                    }
                } else {
                    c--;
                    if (c == 0) {
                        ans += (cur - last + 1);
                    }
                }
            }
        }

        out.println(w * h - ans);

        in.close();
        out.close();
    }

    public void run() {
        try {
            solve();
        } catch (IOException e) {
            e.printStackTrace();
            throw new AssertionError();
        }
    }

    public static void main(String[] args) {
        new Thread(new circles_as()).start();
    }
}