Mikvaot, Chapter Two, Mishnah Five
Picture a hole in the ground that is to be used for a mikveh. There is currently no water in the hole, but there are three cavities adjacent to the hole, each of which has in it one log of drawn water. If this water is part of the mikveh, it might invalidate the valid waters. Our mishnah deals with the potential validity of such a mikveh.
1) If there were three cavities in a mikveh each holding a log of drawn water, if it is known that forty seahs of valid water fell in before reaching the third cavity, [such a mikveh is] valid; otherwise it is invalid.
2) Rabbi Shimon declares it valid, since it resembles a mikveh adjoining another mikveh.
Section one: As long as the forty seahs of valid water get into the mikveh before they are joined by the third log of drawn water, the mikveh is valid. As is always the case, less than three logs of drawn water do not invalidate a mikveh and three logs invalidates the mikveh only before there are already forty seahs of valid water. Since in this case, the forty seahs were in the mikveh before the third log of drawn water, the mikveh is valid.
Section two: If there is a mikveh of drawn water that is next to a mikveh of valid water that doesn’t have forty seahs, the drawn water does not invalidate the valid water. So too, according to Rabbi Shimon, the cavities of drawn water that are next to the mikveh do not invalidate the other water in the mikveh.