Unprotected sex with ejaculation just before and after the period is very much safe if your previous cycle was regular. Here, chance of being pregnant is almost nil. So, you have nothing to worry.
Ovulation occurs 14 days prior to expected due date and fertile days are 11th-18th day of each 28-30 days cycle.
Practice safe sex
in future. Good luck.