cho.sh
Notes
Loading...

Pizza

Time limit

2s

Memory limit

128 MB

Problem

A circular pizza is centered at (0, 0). Min-sik wants to make one straight cut that divides the pizza into two pieces of equal area. Such a cut must be a line passing through the center.

Each topping is represented by one point on the plane. A cut is called beautiful if the topping arrangement on one side is the mirror image of the arrangement on the other side with respect to the cut line. A topping placed exactly on the cut line matches itself.

Given the topping positions, count how many beautiful cuts exist. The pizza is large enough to contain every topping.

Input

The first line contains the number of toppings N. N is a positive integer not greater than 50.

Each of the next N lines contains the coordinates of one topping. Every coordinate is an integer whose absolute value is at most 500, and no two toppings have the same position.

Output

Print the answer on the first line. If there are infinitely many beautiful cuts, print -1.