You 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](https://en.wikipedia.org/wiki/Point_reflection) in respect of point *P*.
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*<sub class="lower-index">*i*</sub> and *y*<sub class="lower-index">*i*</sub> ( - 10<sup class="upper-index">6</sup>  ≤  *x*<sub class="lower-index">*i*</sub>,  *y*<sub class="lower-index">*i*</sub>  ≤  10<sup class="upper-index">6</sup>) — the coordinates of the points. It is guaranteed that no two points coincide.
Picture to the first sample test:

<img class="tex-graphics" src="https://espresso.codeforces.com/eedc60313be8684bd6169b8b23f0f0afd92479a8.png" style="max-width: 100.0%;max-height: 100.0%;"/> 

In the second sample, any line containing the origin is good.
3
1 2
2 1
3 3
3
2
4 3
1 2
-1
6
0 4
1 5
2 1
3 2
4 3
5 0
5
1
5 2
-1
4
2 4
1 2
0 0
-2 -4
1
10
0 5
1 0
2 3
3 2
4 6
5 9
6 1
7 8
8 4
9 7
5
9
-1000000 -500000
-750000 250000
-500000 1000000
-250000 -250000
0 -1000000
250000 750000
500000 0
750000 -750000
1000000 500000
5
10
-84 -60
-41 -100
8 -8
-52 -62
-61 -76
-52 -52
14 -11
-2 -54
46 8
26 -17
0
5
-1000000 -500000
-500000 0
0 500000
500000 1000000
1000000 -1000000
3
6
-100000 100000
-60000 -20000
-20000 20000
20000 60000
60000 -100000
100000 -60000
5
8
-10000 4285
-7143 -10000
-4286 -1429
-1429 -7143
1428 1428
4285 9999
7142 7142
9999 -4286
5
10
-1000000 -777778
-777778 555554
-555556 333332
-333334 111110
-111112 999998
111110 -333334
333332 -1000000
555554 -555556
777776 -111112
999998 777776
3
7
14 -3
2 -13
12 -1
10 -7
8 -11
4 -9
6 -5
5
24
-1 -7
-37 -45
-1 -97
-37 -25
9 -107
-47 -85
-73 -43
-73 -63
9 -87
-63 -3
-47 -35
-47 -15
15 -39
-11 -87
-63 -73
-17 -65
-1 -77
9 -17
-53 -63
-1 -27
-63 -53
-57 -25
-11 3
-11 -17
2
8
11 -3
12 -5
10 -6
9 -4
8 -8
6 -7
7 -10
5 -9
4
32
16 37
-26 41
5 -6
12 -5
17 -30
-31 -14
-35 4
-23 -20
17 -20
-25 34
-33 40
-32 33
15 24
22 -25
-30 -21
13 -12
6 -13
6 37
-40 -1
22 25
16 17
-16 21
11 42
11 32
-26 21
-35 -6
12 -25
23 18
-21 16
-24 -13
-21 26
-30 -1
3
10
-7 6
-16 11
-9 -5
3 4
-8 12
-17 6
2 -1
-5 15
-7 4
-6 -2
-1
10
-8 11
1 10
2 10
2 11
0 9
3 12
-7 16
11 4
4 8
12 9
3
10
9 6
8 1
-10 13
-11 8
-1 6
0 8
-2 7
-1 7
1 17
-3 -3
3
20
12 -3
-18 -24
-13 7
17 -23
15 11
-17 5
0 -26
18 10
12 -18
-14 -26
-20 -24
16 4
-19 -21
-14 -11
-15 -19
-18 12
16 10
-2 12
11 9
13 -25
5
50
-38 -107
-34 -75
-200 -143
-222 -139
-34 55
-102 -79
48 -99
2 -237
-118 -167
-56 -41
10 17
68 -89
-32 41
-100 -93
84 -1
86 -15
46 -145
-58 -117
8 31
-36 -61
-12 21
-116 79
88 -205
70 -103
-78 -37
106 -5
-96 -201
-60 -103
-54 45
-138 -177
-178 -47
-154 -5
-138 83
44 -131
-76 -191
-176 -61
-14 -65
-210 53
-116 -181
-74 -205
-174 -15
0 -223
-136 69
-198 -57
-76 -51
-152 -19
-80 -83
22 -227
24 -141
-220 -153
7
6
-10 -10
-10 10
10 10
10 -10
10 11
10 -11
1
from fractions import Fraction
import time


class Point:
    def __init__(self, x, y):
        self.x = x
        self.y = y

    def to_tuple(self):
        return (self.x, self.y)

    def __repr__(self):
        return "Point({}, {})".format(self.x, self.y)

    def __eq__(self, other):
        return self.to_tuple() == other.to_tuple()

    def __hash__(self):
        return hash(self.to_tuple())

    def __neg__(self):
        return Point(-self.x, -self.y)

    def __add__(self, other):
        return Point(self.x+other.x, self.y+other.y)

    def __sub__(self, other):
        return self+(-other)

    def scalar_mul(self, mu):
        return Point(mu*self.x, mu*self.y)

    def int_divide(self, den):
        return Point(self.x//den, self.y//den)


class Line:
    def __init__(self, a, b, c):
        # ax+by+c=0
        self.a = a
        self.b = b
        self.c = c

    def __repr__(self):
        return "{}*x + {}*y + {} = 0".format(self.a, self.b, self.c)

    @classmethod
    def between_two_points(cls, P, Q):
        return cls(P.y-Q.y, Q.x-P.x, P.x*Q.y-P.y*Q.x)

    def evaluate(self, P):
        return self.a*P.x+self.b*P.y+self.c

    def direction(self):
        if self.a == 0:
            return (0, 1)
        return (1, Fraction(self.b, self.a))


true_start = time.time()
n = int(input())
points = set()
center = Point(0, 0)
for i in range(n):
    row = input().split(" ")
    cur = Point(int(row[0]), int(row[1])).scalar_mul(2*n)
    center += cur
    points.add(cur)

center = center.int_divide(n)
dcenter = center+center

sym_points_set = set()
for p in points:
    sym_points_set.add(dcenter-p)
nosym = list(points - sym_points_set)

if len(nosym) == 0:
    print(-1)
    exit(0)


cnt = 0
p0 = nosym[0]
good_lines = set()
for p in nosym:
    m = (p+p0).int_divide(2)
    line = Line.between_two_points(m, center)
    distances = list(map(line.evaluate, nosym))

    ok = True
    mydict = {}
    for dd in distances:
        dda = abs(dd)
        if dda not in mydict:
            mydict[dda] = 1
        else:
            mydict[dda] += 1
    for k in mydict:
        if mydict[k] % 2 == 1 and k != 0:
            ok = False
            break
    if ok:
        good_lines.add(line.direction())

print(len(good_lines))
