The factory cuts rectangular M × N granite plates into pieces using a special machine that is able to perform cuts in 4 different directions: vertically, horizontally, and diagonally at the angle of 45 degrees to the sides of the plate. Every cut is a straight line that starts and ends on the side of the plate.
The factory has been ordered to produce tiles for the inlay, each tile
of which is a 45 degrees right triangle. To reduce the time to deliver
the tiles it was decided to take all triangles from the already cut plates. Information about all performed cuts is available and your task is to compute the number of triangles of any size that were produced.
Input
The input describes the cuts that were performed on a single
rectangular plate. The first line contains three integers M, N, and K, separated by spaces. M and N
(1 ≤ M, N ≤ 50) are the dimensions
of the plate, and K (0 ≤ K ≤ 296) is
the number of cuts. Next K lines describe the cuts. i^{th} cut is described by four integer numbers X_{i,1}, Y_{i,1}, X_{i,2}, and Y_{i,2},
separated by spaces, that represent the starting and ending point
of the cut. Both starting (X_{i,1}, Y_{i,1}) and
ending (X_{i,2}, Y_{i,2}) points of the cut are
situated on the plate's border. Both points of the cut are different
and the cut goes through the plate. Here, the coordinates by the X axis run from 0 to M, and the coordinates by the Y axis run from 0 to N. All cuts are different.
Output
Write the number of triangles that were produced by the cuts.
Samples
input  output 

4 4 4
1 4 1 0
0 4 4 0
0 0 4 4
0 2 4 2
 6

7 4 6
6 0 7 1
1 4 1 0
0 4 4 0
0 0 4 4
0 2 7 2
7 0 3 4
 8

Problem Author: Elena Kruchkova
Problem Source: 20022003 ACM Northeastern European Regional Programming Contest