I'm having some problems with rewriting the Maxwell Lagrangian. The text states, \begin{align}\mathcal{L}&=-\dfrac{1}{4}F_{\mu\nu}F^{\mu\nu}-A_\mu J^\mu \\ &= -\dfrac{1}{2}(\partial_\mu A_\nu)^2 + \dfrac{1}{2}(\partial_\mu A^\mu)^2-A_\mu J^\mu.\end{align}
I see that we are just using $F_{\mu\nu} = \partial_\mu A_\nu - \partial_\nu A_\mu$ and I understand how we get the first term. But, in order to get the second term we would need $$(\partial_\mu A_\nu)(\partial^\nu A^\mu) = (\partial_\mu A^\mu)^2.$$
Am I missing something here and if not why is $(\partial_\mu A_\nu)(\partial^\nu A^\mu) = (\partial_\mu A^\mu)^2$?