PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#GL0000214. Số hợp mạnh (Strongly Composite)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Số hợp mạnh (Strongly Composite)

Số hợp mạnh (Strongly Composite)

Source: Codeforces

Version: Phuoc Hung OJ Extended

Problem Statement

An integer greater than one is strongly composite if it is composite and the number of its distinct prime divisors does not exceed the number of its composite divisors. The divisor 11 is neither prime nor composite. Given integers ai>1a_i>1, replace their product with a product of the maximum possible number of strongly composite integers bj>1b_j>1. Output the maximum count, or 00 if no factorization exists.

Input

The first line contains nn, followed by nn positive integers ai>1a_i>1.

Output

Print the maximum possible count kk.

Subtasks

  • Subtask 1 (20 points): 1≤n≤101\le n\le 10; 2≤ai≤1002\le a_i\le 100.

  • Subtask 2 (30 points): 1≤n≤1001\le n\le 100; 2≤ai≤1000002\le a_i\le 100000.

  • Subtask 3 (50 points): 1≤n≤10001\le n\le 1000; 2≤ai≤100000002\le a_i\le 10000000.

Examples

Example 1

Input

3
3 10 14

Output

2

Explanation

The product is 420=4*105; both 4 and 105 are strongly composite.

Example 2

Input

2
2 3

Output

0

Explanation

The product 6 has no strongly composite factorization.