n=gets.to_i
l2=[]
l5=[]
n.times do
  a=gets.chomp
  if a.include?(".")
    d=a.split(".")[1].size
  else
    d=0
  end
  a=a.delete(".").to_i
  c2,c5=0,0
  while a%2==0
    a/=2
    c2+=1
  end
  l2 << c2-d
  while a%5==0
    a/=5
    c5+=1
  end
  l5 << c5-d
end
c=0
n.times do |i|
  i.times do |j|
    c+=1 if l2[i]+l2[j]>=0&&l5[i]+l5[j]>=0
  end
end
puts c
