7389 - Merge Prime   

Description

Give you many distinct numbers, please find the maximum number of the pairs (a, b) such that the sum of a and b is a prime number.
One number can only use once.
For example, the set is 4, 5, 6, and 7. The maximum number of the set is 2. The groups are {4, 7} and {5, 6}. Their summations are both 11.

Input

Each test case starts with a line containing n (1<= n <= 400), the number of points. The following n lines are n numbers (1<=number<=1000000)
One number will only appear one time.

Output

Print the maximum pair number.

Sample Input  Download

Sample Output  Download

Tags




Discuss