Hurting

So I found out I was pregnant at 5 weeks went for an ultrasound at 7 weeks heartbeat was good everything was good but but I had been having cramps and they found pregestational bleeding so my Dr wanted another ultrasound a month later well they did one at 10 weeks which was the day before yesterday and I was scared to even go cause I felt like something was wrong and sure enough there was no heartbeat so they gave me the pills to start miscarriage and I passed it yesterday well the day I found out was hard I hung in good yesterday but today is so hard all I want to do is hide and cry I feel stupid cause I wasn't that far along but I wanted this baby so bad how long will I feel like this? Sorry for running on not good at punctuation