Stained Glass

No attempts yetTime limit2sMemory limit128 MB

Problem

Mr. Wincenty is delighted that he finally solved his garden problem. With the free time he suddenly gained, he decided to pursue one of his many interests: designing stained glass.

He sat down at his desk with a pencil and ruler, prepared a sheet of thick paper, and drew NN straight lines across it. When he finished, he counted how many pieces the lines had cut the sheet into, and found the number smaller than he had hoped. "Maybe I should slide the lines around in my design," he wondered.

Each line may be translated (shifted) freely in the plane, but its direction (slope) must stay the same. Compute the maximum number of pieces (regions) the sheet can be divided into.

Input

The first line contains one integer NN (1N2000001 \le N \le 200000), the number of lines. Each of the next NN lines describes one line.

Each line is given by four space-separated integers X1,Y1,X2,Y2X_1, Y_1, X_2, Y_2 (10000000X1,Y1,X2,Y210000000-10000000 \le X_1, Y_1, X_2, Y_2 \le 10000000), denoting the straight line passing through the two points (X1,Y1)(X_1, Y_1) and (X2,Y2)(X_2, Y_2). The two points describing a line are always distinct.

Output

Output a single line with the maximum number of pieces described above.