Having sex during and after my period

I had sex several times over the last few days and my fertile window is a few days away could I still get pregnant if I had sex just before my fertile period as I have heard sperm can survive inside a woman for a up to 5 days inside a woman's body