NZEC in calculating Number of factors

I am trying to solve this question, but I am getting NZEC error.
This is my solution
Can anyone help me fixing this issue.


Large numbers will easily overflow your ‘product’ variable they are multiplied to.

how should I resolve this, faced this problem many times

Use some Bigint implementation or go around the problem(e.g. do what you are doing for all the numbers on input and merge the results)