Let a, b and c be x-coordinates of the three vertices. You are given that a + b + c = 10. Midpoints have x-coordinates 0.5(a+b), 0.5(a+c) and 0.5(b+c). When you add them, you will get 0.5(a+b) + 0.5(a+c) + 0.5(b+c) = a + b + c = 10, i.e. the same 10 units as your answer.