
Explanation:
Box 1: 1
In a multi-domain Active Directory forest, you should have at least one Domain Naming Master and one RID Master online for full functionality. The Domain Naming Master role is forest-wide, while the RID Master role is per-domain. Having at least one of each ensures that domain creation and object creation/movement can continue without interruption.
Box 2: 5
Five RID masters, one for each domain.
Reference:
https://theitbros.com/fsmo-roles/