from math import radians, cos, sin, asin, sqrt

def metro_distance(lat1, long1): 
    list_dist = []
    for i in list_metro:
        lat1 =  radians(lat1)
        long1 = radians(long1)
        lat2 = radians(i[0])
        long2 = radians(i[1])

        dlong =  long2 - long1
        dlat = lat2 - lat1
        g = sin(dlat / 2)**2 + cos(lat1) * cos(lat2) * sin(dlong / 2)**2
        c = 2 * asin(sqrt(g))

        r = 6371   # Radius of earth in kilometers.
        dist = (c * r)

        list_dist.append(dist)
    min_dist = min(list_dist)
    if min_dist < 1.0:
        dist_coef = 3
    elif 1.0 < min_dist < 2.0:
        dist_coef = 2
    else:
        dist_coef = 1
    return dist_coef
