program plakatas;
  const PRF = 'SIENA.IN';
  var a, b, //sienos parametrai
      N,    //plakatų kiekis
      x1, y1, x2, y2, //plakato koordinatės
      plotas, plakato_pl, //sienos ir plakato plotas
      i : longint;
      f: text;
begin
  assign (f, PRF);
  reset (f);
  readln (f, a, b, N);
  plotas := a * b;
  for i := 1 to N do begin
    readln (f, x1, y1, x2, y2);
    plakato_pl := (x2 - x1) * (y2 - y1);
    plotas := plotas - plakato_pl;
  end;
  writeln (plotas);
  readln;
end.