I have a question

I had unprotected sex at around 10 o clock last night and then I took aftera (a brand of the mornig after pill) at around 1am. Should I have waited 12 hours or is it good that I took it three hours after sex?