Brufen is a good medications provided you don't have any contraindications (you must have taken it earlier without any problem)
But pain meds are not the answer to sports related pains
Next Steps
Involve a proper warm up and stretch before strenuous exercise.
Health Tips
Take brufen after meal and not beyond prescribed quantity.
This is just a suggestion