Energetic requirements of the transition from solitary to group living