You say you didn’t mention the number because you were nervous, I suppose it depends what this means exactly.
I can’t say what exactly happened in your situation, as it may have not been fully intentional (like if you were having an anxiety attack and couldn’t think or something, I have no idea). Anyway, if I deliberately and knowingly withheld the number of times I committed a mortal sin, I would go back and confess that I made a sacrilegious confession (and maybe how, noting that it was deliberate), and then confess my mortal sins again with the numbers, or approximations if the numbers are unknown. Since it’s essentially withholding mortal sins (i.e. skipping Mass three times is three sins, not one).
If on the other hand it was not intentional, one would need to mention the forgotten sins (numbered) at the next confession, but the previous one retains its validity and the sins are forgiven.