Given N natural numbers a1,a2....aN and two weird functions f(x) and g(x).
g(x)= sum of digits of x
f(x)=1+(x∑i=1g(ai))%9−g(x∑i=1ai)%9 if x % (k∗k)=0, k∈N and k≠1
f(x)=0 otherwise.
Your task is to find the value of N∑i=1f(i)
Input:
First line of input contains a single integer N
Next N lines contains the natural numbers a1,a2,..aN
Output:
Output a single integer containing the required answer.
Constraints:
1≤N≤2∗107
1≤ai≤1010000