Pregnancy tests

How many days after unprotected sex can you take a pregnancy test?