In order to reduce the risk of neural tube defects in the fetus, the most important time for a woman to consume adequate amounts of folate is: