Sex after miscarriage

When is it safe to have sex after an extremely early miscarriage?