题目描述
Problem
Select 3 grid points from the closed rectangular section surrounded by points (0,0), (n-1,0), (0, m-1), (n-1, m-1) and make a triangle. make.
At this time, the absolute difference between the number of triangles containing the point (x1, y1) but not the point (x2, y2) and the number of triangles containing the point (x2, y2) but not the point (x1, y1) Find the value.
Those whose points are on the border are considered to be included in the triangle.
However, if the three points are aligned in a straight line, it is not considered to be a triangle.
Constraints
- 2 ≤ n, m ≤ 500
- 0 ≤ x1, x2 ≤ n-1
- 0 ≤ y1, y2 ≤ m-1
- (x1, y1) ≠ (x2, y2)
Input
n m x1 y1 x2 y2
All inputs are given as integers.
N, m, x1, y1, x2, y2 are given on one line, separated by blanks.
Output
Output the absolute value of the difference on one line.
Examples
Input
2 2 0 0 0 1
Output
0
Input
3 2 1 0 0 0
Output
3
输入格式
见题面
输出格式
见题面