\[E_{\mbox{tot}}=\sum_{i=1}^N\frac{m_ic^2}{\sqrt{1-\frac{v_i^2}{c^2}}}=\sum_{i=1}^N\gamma_im_ic^2\]