A fish lives its whole life in salty water, so why is its flesh still sweet? As long as it's alive, its body keeps filtering the salt out. Yaakov Avinu tells Esav, "Im Lavan garti", and Rashi teaches that garti has the same gematria as 613, the number of mitzvot. For twenty years Yaakov lived with Lavan the trickster and didn't absorb a single drop of his ways, because he stayed connected to the Torah and the mitzvot. Your surroundings don't decide who you become, as long as your soul stays alive and connected.