Problem

11 /23


Based on the Unified State Examination 2017

Problem

Given a set of N natural numbers. It is necessary to determine the number of pairs of elements (ai, aj) of this set, in which \(1 <= i < j <= N\) and the product of the elements is a multiple of 14.
Write a time and memory efficient program to solve this problem. 


Input data
The first line of the input specifies the number of numbers N (\(1 < N <= 10000\)). Each of the following N lines contains one natural number not exceeding 1000.


Imprint data
Print the answer to the problem.
 

 

Examples
# Input Output
1 5
14
7
7
2
19
6