What to count as end of period?

Do you count your period ending as when you dont see any blood anymore at all or when it becomes brown and only when you wipe?