int input sch k40 40 k4030 40 for in range int input 40 b1 40 40 40 if

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
n = int(input())
sch = 0
k40 = [0]*40
k4030 = [0]*40
q = 0
for i in range(n):
a = int(input())
b = a%40; b1 = (40 - b%40)%40
if a >= 30:
sch += k40[b1] + k4030[b1]
k4030[b] += 1
else:
sch += k4030[b1]
k40[b] += 1
print(sch)