Triangle

No attempts yetTime limit1sMemory limit128 MB

Problem

A lattice point is an ordered pair (x,y)(x, y) where both xx and yy are integers. Given the coordinates of the three vertices of a triangle, all of which are lattice points, count how many lattice points lie strictly inside the triangle. Points that lie on an edge or at a vertex do not count.

Input

The input contains several test cases. Each test case consists of six integers x1x_1, y1y_1, x2x_2, y2y_2, x3x_3, y3y_3, the coordinates of the vertices (x1,y1)(x_1, y_1), (x2,y2)(x_2, y_2), and (x3,y3)(x_3, y_3). Every triangle is non-degenerate (it has positive area), and every coordinate satisfies 15000x1,y1,x2,y2,x3,y315000-15000 \le x_1, y_1, x_2, y_2, x_3, y_3 \le 15000. The end of the input is marked by a test case with x1=y1=x2=y2=x3=y3=0x_1 = y_1 = x_2 = y_2 = x_3 = y_3 = 0, which must not be processed.

Output

For each test case, print the number of interior lattice points on its own line.