6 litres from each can!
Say the ratio of 12 litre from first container = X, and ratio of 12 litre from second container = Y,
then comparing ratios of milk from each container to final ratio of milk in 12 litre,
=> 3/4X+1/2Y = 5/8
similarly, comparing ratios of water from each container to final ratio of water in 12 litre,
1/4X+1/2Y = 3/8
Solving both equations we get, X=1/2 and Y=1/2...so we will get 12/2 = 6 litres from each container.
check: 3/4*1/2+1/2*1/2 = 3/8+1/4 = 5/8