Center of mass of system of $N$ particles is
$$\tag{1} \vec{R} = \frac{\displaystyle \sum_{i = 1}^N m_i \vec{r}_i}{\displaystyle \sum _{i = 1}^N m_i} $$
where $m_i$ and $\vec{r}_i$ are mass and position of particle $i$, respectively. If the stystem of particles consists of $B$ objects, then center of mass of the system of particles is
$$\tag{2} \begin{array}{rcl} M \vec{R} & = & \displaystyle \sum_{i = 1}^{N_1} m_i \vec{r}_i + \sum _{i = N_1 + 1}^{N_1 + N_2} m_i \vec{r}_i + \cdots + \sum _{i = N - N_B + 1}^{N} m_i \vec{r}_i \newline & = & \displaystyle M_1 \vec{R}_1 + M_2 \vec{R}_2 + \cdots + M_B \vec{R}_B \end{array} $$
where $M_j$ and $\vec{R}_j$, for $j = 1, \dots, B$, are mass and center of mass of object $j$, respectively. Notice that object $j$ consists of $N_j$ particles, so that
$$\tag{3} N = \sum_{j = 1}^B N_j $$
is number of particles.
- Michael A. Gottlieb, Rudolf Pfeiffer (eds.), “Center of Mass; Moment of Inertia”, in Richard P. Feynman, Robert B. Leighton, Matthew Sands, The Feynman Lectures on Physics, Vol. I: The New Millennium Edition: Mainly Mechanics, Radiation, and Heat, California Institute of Technology, 3rd version, 2013, chapter 19, url https://www.feynmanlectures.caltech.edu/I_19.html [20221124].