counting contractions

I am so lost on how to count them & when I need to go to the hospital. Yesterday evening I lost some of my mucus plug it was yellowish & snot like. I had lower back pain all night along with some contractions. Around 2 am I lost the bloody show. I still have lower back pain & some contractions. I don't know what my next step is. First time mom & I am getting nervous!