How to know really how many weeks of pregnancy?

Sinai
My last period started July 3, the app says I am on the 5 week but 5 weeks ago I had my period. Someone knows this?