from heapq import heappop as hpop, heappush as hpush from decimal import Decimal MAX = 2*10**9 def dijkstra (s, t, L, n): d = [MAX for i in range(n)] Q = list() d[s] = 0 hpush(Q,(0,s)) while Q: tmp = hpop(Q) for v in L[tmp[1]]: if tmp[0] > v[0]: tmpd = tmp[0] else: tmpd = v[0] if tmpd < d[v[1]]: d[v[1]] = tmpd hpush(Q, (tmpd,v[1])) return d[t] def dist(p1, p2): d = (Decimal((p1[0]-p2[0])**2 + (p1[1]-p2[1])**2)).sqrt() i_d = int(d) return i_d + (d>i_d) N = int(raw_input()) xy = [map(int,raw_input().split()) for i in xrange(N)] l = [[(dist(xy[i],xy[j]),j) for j in xrange(N) if j != i] for i in xrange(N)] print (dijkstra(0,N-1,l,N)+9) / 10 * 10