f=open('file_for_ege-27_st23002-02-F-перебор.txt','r')
n=int(f.readline())
a=[]
for i in range(1,n+1):
a.append(int(f.readline()))
w=0
for i in range(n):
for j in range(i+1,n):
x=a[i]
y=a[j]
z=x*y
k=0
while z%10 ==0:
k+=1
z=z//10
if k == 6:
w+=1
print(w)