p/(1-p) = N
Multiply both sides by (1-p):
p = N*(1-p)
Distribute (multiply) the N across the terms in the parentheses:
p = N - Np
Add Np to both sides:
p + Np = N
Factor out the p on the left hand side:
p(1+N) = N
Divide both sides by (1+N)
p = N/(1+N)