Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ACM-ICPC mode for virtual contests.
If you've seen these problems, a virtual contest is not for you - solve these problems in the archive.
If you just want to solve some problem from a contest, a virtual contest is not for you - solve this problem in the archive.
Never use someone else's code, read the tutorials or communicate with other person during a virtual contest.

No tag edit access

F. Symmetric Projections

time limit per test

2 secondsmemory limit per test

256 megabytesinput

standard inputoutput

standard outputYou are given a set of *n* points on the plane. A line containing the origin is called good, if projection of the given set to this line forms a symmetric multiset of points. Find the total number of good lines.

Multiset is a set where equal elements are allowed.

Multiset is called symmetric, if there is a point *P* on the plane such that the multiset is centrally symmetric in respect of point *P*.

Input

The first line contains a single integer *n* (1 ≤ *n* ≤ 2000) — the number of points in the set.

Each of the next *n* lines contains two integers *x*_{i} and *y*_{i} ( - 10^{6} ≤ *x*_{i}, *y*_{i} ≤ 10^{6}) — the coordinates of the points. It is guaranteed that no two points coincide.

Output

If there are infinitely many good lines, print -1.

Otherwise, print single integer — the number of good lines.

Examples

Input

3

1 2

2 1

3 3

Output

3

Input

2

4 3

1 2

Output

-1

Note

Picture to the first sample test:

In the second sample, any line containing the origin is good.

Codeforces (c) Copyright 2010-2017 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Nov/24/2017 13:47:22 (p1).

Desktop version, switch to mobile version.

User lists

Name |
---|