int input def for in range n-i return for in range int input if 14 eli

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
n = int(input())
def f(x):
t = 0
for i in range(1,x+1):
t += n-i
return t
a = 0
b = [0,0]
for i in range(n):
x = int(input())
if x%14 == 0: a += 1
elif x%2 == 0: b[1] += 1
elif x%7 == 0: b[0] += 1
print(b[0]*b[1]+f(a))