Need help!

When starting to use the pill how long should you be taking it before having unprotected sex?