Didn't know I was pregnant

I just found out I am pregnant with my first baby and I am very nervous. I am terrified because I continued to smoke and used over the counter medication. Now that I know I will not smoke or take anything but I feel terrible because I don't know how much damage I have done the past 3 weeks to my baby. I honestly didn't think I was pregnant and I feel aweful.