To keep the front view and side view the same, new cubes can only be added in hidden spaces.
Check each position in the solid.
A cube can be added only if it does not make any front column or side column taller.
From the diagram, the maximum number of hidden cubes that can be added is 8.
8