Due date calculations??

Those of you who have already been to the doctor: How did your doctor calculate due date? I know they go by first day of last period and I also know the initial due date can change after ultrasound, BUT...did they count 40 weeks from first day of period OR 9 months + 1 week or what?? I know both would give similar due dates, but one would put me on my mom’s birthday if I’m pregnant this month. So how do most doctors calculate???