{$q+,r+}
uses
    sysutils, math;

const
    max_n = 100;
var
    i, j, k, n: longint;
    u: array [1..max_n] of boolean;
    x, y, r: array [1..max_n] of longint;
    x1, y1, x2, y2: longint;
    sx, sy, s: longint;
begin
    read(sx, sy, n);
    for i := 1 to n do begin
        read(x[i], y[i], r[i]);
    end;

    s := 0;
    fillchar(u, sizeof(u), 0);
    for i := 1 to n do if not u[i] then begin
        u[i] := true;
        x1 := x[i] - r[i];
        y1 := y[i] - r[i];
        x2 := x[i] + r[i];
        y2 := y[i] + r[i];
        for j := 1 to n do if not u[j] then begin
            for k := 1 to n do if not u[k] then begin
                if 
                    (max(x[k] - r[k], x1) <= min(x[k] + r[k], x2)) and
                    (max(y[k] - r[k], y1) <= min(y[k] + r[k], y2))
                then begin
                    u[k] := true;
                    x1 := min(x[k] - r[k], x1);
                    y1 := min(y[k] - r[k], y1);
                    x2 := max(x[k] + r[k], x2);
                    y2 := max(y[k] + r[k], y2);
                end;
            end;
        end;
        s := s + (x2 - x1) * (y2 - y1);
    end;

    writeln(sx * sy - s);

    close(input);
    close(output);
end.