Distance function of BUS.