import heapq N=int(input()) P=[tuple(map(int,input().split())) for i in range(N)] DP=[1<<60]*N DP[0]=0 Q=[(0,0)] while Q: dis,x=heapq.heappop(Q) if DP[x]!=dis: continue a,b=P[x] for i in range(N): c,d=P[i] d=(a-c)**2+(b-d)**2 yy=int(d**(1/2)) score=0 for j in range(yy-5,yy+5): if j<=0: continue if j*j>=d: score=j break if DP[i]>max(score,DP[x]): DP[i]=max(score,DP[x]) heapq.heappush(Q,(DP[i],i)) print(DP[-1]//10*10)