Divine Divisor

No attempts yetTime limit3sMemory limit128 MB

Problem

An integer N>1N > 1 is given. For an integer d>1d > 1, we say that dd is a divisor of NN with multiplicity k>0k > 0 (where kk is an integer) if dkNd^k \mid N but dk+1Nd^{k+1} \nmid N. For example, N=48=243N = 48 = 2^4 \cdot 3 has, among others, the divisor 22 with multiplicity 44, the divisor 33 with multiplicity 11, the divisor 44 with multiplicity 22, and the divisor 66 with multiplicity 11.

We call dd a divine divisor of NN if dd is a divisor of NN with some multiplicity kk and NN has no divisor whose multiplicity is greater than kk. In other words, a divine divisor is a divisor that attains the maximum multiplicity over all divisors of NN. For example, the only divine divisor of 4848 is 22 (with multiplicity 44), while the divine divisors of 66 are 22, 33, and 66 (each with multiplicity 11).

Determine the maximum multiplicity kk over all divisors of NN, and the number of divine divisors of NN.

Input

NN is given in a slightly unusual form. The first line contains a single integer nn (1n6001 \le n \le 600). The second line contains nn integers a1,a2,,ana_1, a_2, \ldots, a_n (2ai10182 \le a_i \le 10^{18}), separated by single spaces. They define N=a1a2anN = a_1 \cdot a_2 \cdot \cdots \cdot a_n.

Output

Print two lines. The first line contains the largest integer kk for which some divisor d>1d > 1 of NN satisfies dkNd^k \mid N. The second line contains the number of divine divisors of NN, that is, the number of divisors whose multiplicity equals kk. This value can be very large, so print it as an exact integer.