In a mixture of 40 litres, the ratio of milk: water is 4: 1. If some quantity of mixture is taken out and then 4 litres milk and 4 litres of water is added to the mixture, then the ratio of milk and water becomes 8: 3. Find the quantity of the mixture that was taken out.