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.
# -*- coding: utf-8 -*-

import math
import collections
import bisect
import heapq
import time
import random
import itertools
import sys

"""
created by shhuan at 2017/11/14 11:20

"""


N = int(input())

A = []
eps = 1e-5


for i in range(N):
    x, y = map(int, input().split())
    A.append((x, y))

center = sum([x for x, _ in A])/N, sum([y for _, y in A])/N


def sym(a, b, c):

    return abs((a[0]+b[0])/2-c[0]) < eps and abs((a[1]+b[1])/2-c[1]) < eps

symed = set()

for i in range(N):
    for j in range(i+1, N):
        a, b = A[i], A[j]
        if sym(a, b, center):
            symed.add(a)
            symed.add(b)

left = {v for v in A if v not in symed}

if not left:
    print(-1)
    exit(0)
ans = 0
lines = set()
for a in left:
    for b in left:
        if a != b:
            c = (a[0]+b[0])/2, (a[1]+b[1])/2
            line = c[1] - center[1], center[0] - c[0]
            if abs(line[0]) < eps and abs(line[1]) < eps:
                print(-1)
                exit(0)
            if abs(line[0]) > eps and abs(line[1]) > eps:
                lines.add(line)


def project(point, line):
    k = line[1]/line[0]
    x, y = point
    x1 = (k*y+x)/(k**2+1)
    y1 = k*x1

    return (x1, y1)

def dist(a, b):
    x1, y1 = a
    x2, y2 = b
    return (x1-x2)**2 + (y1-y2)**2


# print(lines)
for line in lines:
    # y = kx
    ps = set()
    for a in left:
        b = project(a, line)
        ps.add(b)
    c = project(center, line)
    ds = collections.defaultdict(int)
    for p in ps:
        d = dist(c, p)
        if d > eps:
            d = "%.6f" % d
            ds[d] += 1

    if all(v % 2 == 0 for v in ds.values()):
        ans +=1

# project to y axis
ps = {v[1] for v in left}
ds = collections.defaultdict(int)
for p in ps:
    d = abs(p-center[1])
    if d > eps:
        d = "%.6f" % (d)
        ds[d] += 1
if all(v % 2 == 0 for v in ds.values()):
    ans += 1

#project to x axis
ps = {v[0] for v in left}
ds = collections.defaultdict(int)
for p in ps:
    d = abs(p-center[0])
    if d > eps:
        d = "%.6f" % (d)
        ds[d] += 1
if all(v % 2 == 0 for v in ds.values()):
    ans += 1

if ans == 0:
    print(-1)
else:
    print(ans)












