Exterior angle theorem.
In a triangle an exterior angle or angle outside the triangle will always equal the sum of the 2 remote Interior angle or the 2 angles not close to the outside angle.
If you look at the picture I post below the exterior angle theorem is 1+2=3 . So to find answer for your question you should write the equation p+5+p = p+50 and the p=45 degree.