Megumi is a girl who loves number theory. Today is her birthday, so Joseph creates a new function and gives it to her as a gift. The definition of is shown in the formula as follows.
where are prime factors of and
Now Joseph gives you integers and wants you to calculate the following formula.
输入描述:
The first line contains one integer . The second line contains integers .
输出描述:
Output one integer denoting the value of the formula you calculated.