Substitute creates a sub that has 1/4 of the user's health, rounded down. This means its possible to set the HP to allow 4 subs to be created, assuming the user does not take further damage from another source.
For example, a Ninjask with 260 HP creates 65 HP Subs (260/4). It could create 3 subs assuming they were broken each time, each one reducing 65 HP of Ninjask's HP. The fourth would fail since it would take Ninjask to 0 HP. However, when the third sub is created Ninjask is left with exactly enough HP to activate a pinch berry, such as Salac, Petaya and Liechi.
If Ninjask had 261 HP, it could make a fourth sub (261/4 = 65.25, rounded down to 65), and be left with 1 HP afterwards. The third sub does not allow for the activation of a pinch berry in this case, but the fourth one does, since it would take Ninjask below 25% of its health (after 3 subs it will have just more than 25% of its health and therefore not activate a pinch berry).
Also remember that subs each have their own HP, so its possible for them to survive a hit if it would do less than their total, but each's subs HP cannot be restored in anyway. This is why 404 HP total is a significant number, since the Substitutes created from a Pokemon with 404 HP has 101 HP, and is therefore not taken out in one hit by a L100 Pokemon using Seismic Toss or Night Shade, since that does 100 damage. 101 - 100 = 1, so the sub will survive a hit and can be used to block a second hit (but will not survive)