Here the ratio of mixtures( i.e milk , water) doesnot matter. But the important point is that whether the total amount ( either pure or mixture ) being transferred is equal or not.Since the total amount ( i.e 5 cups) being transferred from each one to another , hence A =B.