Zero-momentum frame

If inertial frame $S'$ is moving at velocity $\v v$ relative to frame $S$, then the total momentums of a system observed in both frames are related by $$ \v P' = \v P - M\v v $$ where $M$ is the total mass of the system. (Derivation)

In the zero-momentum frame, the total momentum is 0, so take $$ \v v_{ZM} = \frac{\v P'}{M} = \frac{\sum_i m_i \v u_i}{\sum_i m_i}. $$