Sex after birth

How long did each of you wait to have sex after giving birth? Was it painful? Thanks in advance