Most amphibians have three chambers; for example, this is the case with a frog's heart. There are two atria and one ventricle. The anatomy of the chambers keeps the mixing of the bloodstreams to a minimum.
The right atrium of a frog's heart gets the deoxygenated blood from the veins that drain from the body into the heart, later moving into the the pulmocutaneous arteries and back towards the skin and lungs to get a fresh load of oxygen. The oxygenated blood from the skin and lungs goes into the left side and after leaving the ventricle is sent into the carotid arteries to be delivered to the head and brain. Both atria empty into the solitary ventricle, which is divided into narrow chambers, which is how the mixing of the blood is kept to a minimum.