Ideal group size for a murder/horror mystery

I am writing a short murder/horror mystery adventure. System will be D&D 5e, and players will be level 2 (I plan to give them the 3rd level during the adventure). There will be some strong DM guidance on character creation. Some players will be very inexperienced in TTRPGs. Playing might happen on a table, or online (with player webcams), probably both. I plan to run the adventure several times, and I have a gut feeling that adventure will take 2 sessions to play through.

The focus will be in role-playing, with no risk of player being taken out of the adventure, until at the very final battles at the end. The focus won’t so much be in really solving the mystery like in a detective story either, but just being swept along for the ride, things happening and then players doing what they will. They may try to solve it or just survive, or even party ’till the end as the place goes down around them (meaning probable death at the end).

It is important that each player gets plenty of spotlight time, but without fear of the game stalling if they don’t play well, and without more introverted players feeling exhausted. So I am thinking of designing the events of the adventure for 3 players, allowing 2 or 4 if it is expected that players play well together.

In your experience, what is ideal group size for an adventure like this? For this group size, should I try to encourage or enforce certain kind of group dynamic, via guiding the character creation? What has worked for you? What has not worked, what has ruined an adventure like this, from group dynamic and player fun perspective.