Sex on a period

I've been on the pill for three months and i had unprotected sex while on my period last night with my boyfriend. And my period just stopped. I'm not sure if it was because last week I was heavily spotting from hormone imbalance or because he got me pregnant. Any thoughts?