Some inequalities for sums involving the distance in metric spaces