How to know how many days DPO

How do I count my DPO do I do it when I stoped ovulating or when I had sex ?