Convex Regular Polygon

Time limit1sMemory limit128 MB

Problem

A convex regular polygon is a polygon whose sides all have equal length and whose interior angles are all equal, with every interior angle smaller than $180^\circ$. For example, a square is a convex regular polygon.

You are given the coordinates of three distinct vertices of some convex regular polygon $R$. Among all convex regular polygons that have these three points as vertices, determine the smallest possible number of vertices.

Input

The input consists of several test cases. Each test case is given on three lines; each line contains one vertex $(x_i, y_i)$ of the convex regular polygon $R$ ($-10^4 \le x_i, y_i \le 10^4$).

Each coordinate is accurate to within $10^{-6}$ of its true value (the difference from the exact coordinate is at most $10^{-6}$). The distance between any two points is always at least $1$, and $R$ has at most $1000$ vertices.

The last line of the input is END, which marks the end of the input.

Output

For each test case, print on its own line the minimum possible number of vertices of the convex regular polygon $R$.