import sys input = sys.stdin.readline from collections import defaultdict N=int(input()) if N==0: print(1) exit() P=[list(map(int,input().split())) for i in range(N)] for i in range(N): P[i][0]+=10000 P[i][1]+=10000 # UnionFind Group = [i for i in range(N)] # グループ分け Nodes = [1]*(N) # 各グループのノードの数 def find(x): while Group[x] != x: x=Group[x] return x def Union(x,y): if find(x) != find(y): if Nodes[find(x)] < Nodes[find(y)]: Nodes[find(y)] += Nodes[find(x)] Nodes[find(x)] = 0 Group[find(x)] = find(y) else: Nodes[find(x)] += Nodes[find(y)] Nodes[find(y)] = 0 Group[find(y)] = find(x) LIST=defaultdict(list) for i in range(N): x,y=P[i] LIST[(x//10,y//10)].append(i) for C in LIST: x,y=C X=[] if (x,y) in LIST: X+=LIST[x,y] if (x,y+1) in LIST: X+=LIST[x,y+1] if (x+1,y+1) in LIST: X+=LIST[x+1,y+1] if (x+1,y) in LIST: X+=LIST[x+1,y] if (x+1,y-1) in LIST: X+=LIST[x+1,y-1] #print(X) for i in range(len(X)): for j in range(i+1,len(X)): a,b=P[X[i]] c,d=P[X[j]] if (a-c)*(a-c)+(b-d)*(b-d)<=10*10: Union(X[i],X[j]) ANS=0 LX2=[[] for i in range(N)] for i in range(N): x,y=P[i] LX2[find(i)].append((x//10,y//10)) for i in range(N): if find(i)==i: C=[] LL=sorted(LX2[i]) LL2=[] for a in LL: if LL2 and LL2[-1]==a: continue LL2.append(a) LL=LL2 MAX=0 for j in range(len(LL)): for k in range(j,len(LL)): a,b=LL[j] c,d=LL[k] if (a-c)*(a-c)+(b-d)*(b-d)>MAX-100: C.append(((a-c)*(a-c)+(b-d)*(b-d),LL[j],LL[k])) MAX=max(MAX,(a-c)*(a-c)+(b-d)*(b-d)) #print(C) C.sort(reverse=True) #print(C) for ll,x,y in C: if ll*100