program monsters;

const 
    maxn = 1000;

var
    x1, x2, y1, y2: array [1..maxn] of longint;
    z: array [1..maxn] of boolean;
    m, n, s, k, x, y, i, j: longint;
    c, c2: char;
begin
{    assign(input, 'monsters.in');
    reset(input);
    assign(output, 'monsters.out');
    rewrite(output);}

//    while not seekeof do begin

    read(m, n);
    read(k);
    for i := 1 to k do
    begin
        read(x, y, c2, c);
        case c of
            'N': begin
                x1[i] := x;
                x2[i] := x;
                y1[i] := y;
                y2[i] := n;
            end;
            'S':
            begin
                x1[i] := x;
                x2[i] := x;
                y1[i] := 1;
                y2[i] := y;
            end;
            'W':
            begin
                x1[i] := 1;
                x2[i] := x;
                y1[i] := y;
                y2[i] := y;
            end;
            'E':
            begin
                x1[i] := x;
                x2[i] := m;
                y1[i] := y;
                y2[i] := y;
            end;
        end;
    end;

    for i := 1 to k do
    begin
        for j := 1 to k do if i<>j then
        begin
            if (x1[i] = x2[i]) and (x1[j] = x2[j]) and (x1[i] = x1[j]) and
               (y1[i] = 1) and (y2[j] = n) and (y2[i] >= y1[j]) then
            begin
                y2[i] := n;
            end;
            if (y1[i] = y2[i]) and (y1[j] = y2[j]) and (y1[i] = y1[j]) and
               (x1[i] = 1) and (x2[j] = m) and (x2[i] >= x1[j]) then
            begin
                x2[i] := m;
            end;
        end;
    end;

    fillchar(z, sizeof(z), 0);

    for i := 1 to k do if not z[i] then
    begin
        for j := 1 to k do if not z[i] and not z[j] and (i<>j) then
        begin
            if (x1[j] >= x1[i]) and (x2[j] <= x2[i]) and (y1[j] >= y1[i]) and (y2[j] <= y2[i]) then 
            begin
                z[j] := true;
            end;
        end;
    end;

    s := 0;

    for i := 1 to k do 
        if not z[i] then
        begin
            s := s + (x2[i] - x1[i] + 1) * (y2[i] - y1[i] + 1);
            for j := 1 to k do 
                if (i <> j) and not z[j] then 
                begin
                    if (x1[j] >= x1[i]) and (x2[j] <= x2[i]) and
                       (y1[i] >= y1[j]) and (y2[i] <= y2[j]) then
                    begin
                        dec(s);
                    end;
                end;
        end;

    writeln(s);

//    writeln;

//    end;

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