1) fill 5 liter container with water from tap
2) fill 3 liter container with water from the (1)
3) empty 3 liter container
4) fill 3 liter container with the leftover from 5 liter container
5) fill 5 liter container with water from tap
6) fill the 3 liter container with water from (5)
7) the 5 liter container has now 4 liter of water