How many days Rio needs
Four days gives you room to move the viewpoints to whichever day is clear, which is the single most valuable piece of flexibility here. Three works but forces you to take the weather you get.
The beaches are not a half-day activity in this city — they are where a large part of daily life happens, and building an afternoon around one is a legitimate plan rather than filler.
