Answer
$n=\dfrac{2S-nL}{a}$
Work Step by Step
Using the properties of equality, in terms of $
a
,$ the given equation, $
S=\dfrac{n(a+L)}{2}
,$ is equivalent to
\begin{array}{l}
2S=n(a+L)
\\\\
2S=na+nL
\\\\
2S-nL=na
\\\\
\dfrac{2S-nL}{a}=n
\\\\
n=\dfrac{2S-nL}{a}
.\end{array}