If m^2+n^2=10p^2+10p+1m2+n2=10p2+10p+1, where mm and nn are positive integers and pp is a prime number, what is m+nm+n in terms of pp?

The answer is 4p+34p+3 but I'm not sure how to get there.